From a0236b75e176b924c2aba75a1afd7ffd15f0b727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20B=C3=B6hm?= <188768+fb55@users.noreply.github.com> Date: Wed, 20 Apr 2022 17:28:20 +0100 Subject: [PATCH 1/3] chore(ci): Add coverage reporting Fixes #211 --- .github/workflows/nodejs-test.yml | 19 +++++++++++++++++++ .gitignore | 3 +-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs-test.yml b/.github/workflows/nodejs-test.yml index 1f948228e..0d2b2743d 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,6 +31,9 @@ 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 @@ -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/ From 831efec70e6ea3b04cdc229bef4cba626459eee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20B=C3=B6hm?= <188768+fb55@users.noreply.github.com> Date: Wed, 20 Apr 2022 23:02:55 +0100 Subject: [PATCH 2/3] Drop Node 12, use Node 18 --- .github/workflows/nodejs-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs-test.yml b/.github/workflows/nodejs-test.yml index 0d2b2743d..f4d857b1e 100644 --- a/.github/workflows/nodejs-test.yml +++ b/.github/workflows/nodejs-test.yml @@ -12,7 +12,7 @@ permissions: env: CI: true FORCE_COLOR: 2 - NODE_COV: 16 # The Node.js version to run coveralls on + NODE_COV: 18 # The Node.js version to run coveralls on jobs: lint: @@ -39,9 +39,9 @@ jobs: fail-fast: false matrix: node: - - 12 - 14 - 16 + - 18 - lts/* steps: From e396f80d37cb84a8605d2b2d352f49cff0a01c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20B=C3=B6hm?= <188768+fb55@users.noreply.github.com> Date: Wed, 20 Apr 2022 23:08:25 +0100 Subject: [PATCH 3/3] Use Node 16 for coverage reporting --- .github/workflows/nodejs-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs-test.yml b/.github/workflows/nodejs-test.yml index f4d857b1e..029a58e23 100644 --- a/.github/workflows/nodejs-test.yml +++ b/.github/workflows/nodejs-test.yml @@ -12,7 +12,7 @@ permissions: env: CI: true FORCE_COLOR: 2 - NODE_COV: 18 # The Node.js version to run coveralls on + NODE_COV: 16 # The Node.js version to run coveralls on jobs: lint: