Skip to content

Commit

Permalink
chore(ci): Add coverage reporting (inikulin#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
fb55 authored and jmbpwtw committed Feb 16, 2023
1 parent 451865e commit 9f39419
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/nodejs-test.yml
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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 }}'
3 changes: 1 addition & 2 deletions .gitignore
Expand Up @@ -3,8 +3,7 @@
.vscode
node_modules
docs/build
docs/05_api_reference.md
packages/*/dist/
test/dist/
.DS_Store
tsconfig.tsbuildinfo
coverage/

0 comments on commit 9f39419

Please sign in to comment.