Skip to content

Commit 3259531

Browse files
committed
ci: report coverage via vitest-coverage-report-action instead of codecov
Upload coverage to a PR comment / job summary using vitest's own v8 coverage and davelosert/vitest-coverage-report-action, dropping the codecov upload step (no external service required). Adds the json-summary reporter the action needs and grants pull-requests: write. The codecov badge is kept for now and will be revisited.
1 parent 7dd05d1 commit 3259531

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66

77
permissions:
88
contents: read
9+
# Lets the coverage report action post/update a comment on pull requests.
10+
pull-requests: write
911

1012
jobs:
1113
ci:
@@ -27,10 +29,11 @@ jobs:
2729
run: npm run lint
2830

2931
- name: Test
30-
run: npm test -- --coverage
32+
run: npm test -- run --coverage
3133

32-
- name: codecov
33-
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
34+
- name: Report coverage
35+
if: always()
36+
uses: davelosert/vitest-coverage-report-action@02f3c2e641286b7fa308cd3e430783103ce6103b # v2.12.0
3437

3538
- name: Build
3639
run: npm run build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# quickjs-emscripten-sync
22

3-
[![CI](https://github.com/reearth/quickjs-emscripten-sync/actions/workflows/ci.yml/badge.svg)](https://github.com/reearth/quickjs-emscripten-sync/actions/workflows/main.yml) [![codecov](https://codecov.io/gh/reearth/quickjs-emscripten-sync/branch/main/graph/badge.svg)](https://codecov.io/gh/reearth/quickjs-emscripten-sync)
3+
[![CI](https://github.com/reearth/quickjs-emscripten-sync/actions/workflows/ci.yml/badge.svg)](https://github.com/reearth/quickjs-emscripten-sync/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/reearth/quickjs-emscripten-sync/branch/main/graph/badge.svg)](https://codecov.io/gh/reearth/quickjs-emscripten-sync)
44

55
**Build a secure plugin system for web browsers.**
66

vite.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export default defineConfig({
3030
testTimeout: 30000,
3131
coverage: {
3232
provider: "v8",
33-
reporter: ["text", "json"],
33+
// json-summary is required by the GitHub Actions coverage report;
34+
// json adds the per-file detail it links to.
35+
reporter: ["text", "json", "json-summary"],
3436
},
3537
},
3638
});

0 commit comments

Comments
 (0)