Skip to content

Commit

Permalink
Use Node.js experimental test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ranisalt committed Aug 24, 2024
1 parent 347eb6f commit 12b9eec
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,43 @@ jobs:
- name: Lint
run: npm run lint

coverage:
name: Report coverage
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
cache: npm
node-version: 20

- name: Install dependencies
run: npm ci
env:
npm_config_debug=true

- name: Run tests
run: node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info test.cjs

- name: Merge coverage reports
run: |
sudo apt install -yq lcov
lcov --capture --directory build/ --no-external --output-file lcov-cpp.info
lcov --add-tracefile lcov-cpp.info --add-tracefile lcov.info --output-file lcov.info
lcov --remove lcov.info "*/node_modules/*" --output-file lcov.info
- name: "Send to Codacy"
uses: codacy/codacy-coverage-reporter-action@v1
with:
coverage-reports: lcov.info
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}

test:
strategy:
matrix:
Expand Down

0 comments on commit 12b9eec

Please sign in to comment.