diff --git a/.github/workflows/nodejs-test.yml b/.github/workflows/nodejs-test.yml index 1f948228e..029a58e23 100644 --- a/.github/workflows/nodejs-test.yml +++ b/.github/workflows/nodejs-test.yml @@ -6,9 +6,13 @@ on: - 'dependabot/**' pull_request: +permissions: + contents: read + env: CI: true FORCE_COLOR: 2 + NODE_COV: 16 # The Node.js version to run coveralls on jobs: lint: @@ -27,14 +31,17 @@ jobs: test: name: Node ${{ matrix.node }} runs-on: ubuntu-latest + permissions: + checks: write # for coverallsapp/github-action to create new checks + contents: read # for actions/checkout to fetch code strategy: fail-fast: false matrix: node: - - 12 - 14 - 16 + - 18 - lts/* steps: @@ -52,3 +59,15 @@ jobs: - name: Run Tests run: npm run unit-tests + if: matrix.node != env.NODE_COV + + - name: Run Jest with coverage + run: npm run unit-tests -- --coverage + if: matrix.node == env.NODE_COV + + - name: Run Coveralls + uses: coverallsapp/github-action@1.1.3 + if: matrix.node == env.NODE_COV + continue-on-error: true + with: + github-token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.gitignore b/.gitignore index faaca9753..44961c3bb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,7 @@ .vscode node_modules docs/build -docs/05_api_reference.md packages/*/dist/ test/dist/ -.DS_Store tsconfig.tsbuildinfo +coverage/