Skip to content

Commit

Permalink
project: Add c8, switch to it in CI/CD.
Browse files Browse the repository at this point in the history
Since coverage support is experimental in Node.js and CodeCov seem to
have trouble interpreting it, plus I am unsure whenever Node.js
actually generates a valid coverage file, use `c8` instead for the time
being. I switch to Node once it stabilizes and docs will claim this is
ready to be used in production.
  • Loading branch information
SpacingBat3 committed Dec 26, 2024
1 parent fa298c7 commit 6f19541
Show file tree
Hide file tree
Showing 4 changed files with 496 additions and 8 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,15 @@ jobs:
run: "npm run build"
- name: Run tests with coverage+test reporting
run: |
npm test -- --experimental-test-coverage \
--test-reporter=lcov --test-reporter-destination=lcov.info \
npm run test:coverage -- --experimental-test-coverage \
--test-reporter=spec --test-reporter-destination=stdout \
--test-reporter=junit --test-reporter-destination=junit.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
files: lcov.info
- name: Upload test results to CodeCov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
file: junit.xml
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 2 additions & 1 deletion makers/appimage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"main": "dist/main.js",
"scripts": {
"prepack": "tsc",
"test": "tsc -b tsconfig.test.json && NODE_NO_WARNINGS=1 node --test --experimental-strip-types"
"test": "tsc -b tsconfig.test.json && NODE_NO_WARNINGS=1 node --test --experimental-strip-types",
"test:coverage": "c8 -r json npm test --"
},
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 6f19541

Please sign in to comment.