Skip to content

Commit 12b9eec

Browse files
committed
Use Node.js experimental test coverage
1 parent 347eb6f commit 12b9eec

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/ci.yml

+37
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,43 @@ jobs:
1919
- name: Lint
2020
run: npm run lint
2121

22+
coverage:
23+
name: Report coverage
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
submodules: true
31+
32+
- name: Use Node.js 20
33+
uses: actions/setup-node@v4
34+
with:
35+
cache: npm
36+
node-version: 20
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
env:
41+
npm_config_debug=true
42+
43+
- name: Run tests
44+
run: node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info test.cjs
45+
46+
- name: Merge coverage reports
47+
run: |
48+
sudo apt install -yq lcov
49+
lcov --capture --directory build/ --no-external --output-file lcov-cpp.info
50+
lcov --add-tracefile lcov-cpp.info --add-tracefile lcov.info --output-file lcov.info
51+
lcov --remove lcov.info "*/node_modules/*" --output-file lcov.info
52+
53+
- name: "Send to Codacy"
54+
uses: codacy/codacy-coverage-reporter-action@v1
55+
with:
56+
coverage-reports: lcov.info
57+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
58+
2259
test:
2360
strategy:
2461
matrix:

0 commit comments

Comments
 (0)