diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4383e2..5966b18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,9 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis (SonarCloud) - name: Use Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: 16 + cache: npm - name: Build & test run: | npm ci diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index f31217a..9499ecd 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -15,6 +15,16 @@ jobs: repository: ${{ github.event.workflow_run.head_repository.full_name }} ref: ${{ github.event.workflow_run.head_branch }} fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis (SonarCloud) + - name: Use Node.js + uses: actions/setup-node@v3 + with: + cache: npm + - name: Generate coverage + run: | + npm ci + npm run build + xvfb-run --auto-servernum npm test + shell: bash - name: SonarCloud Scan if: github.event.repository.fork == false uses: SonarSource/sonarcloud-github-action@master