Skip to content

Commit baf4508

Browse files
committed
ci: add Codecov coverage reporting
Install @vitest/coverage-v8 and configure deploy workflow to generate and upload test coverage to Codecov using OIDC authentication.
1 parent c27fbc0 commit baf4508

File tree

3 files changed

+213
-2
lines changed

3 files changed

+213
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
contents: read
1114
steps:
1215
- uses: actions/checkout@v4
1316

@@ -19,8 +22,17 @@ jobs:
1922
- name: Install dependencies
2023
run: npm install --legacy-peer-deps
2124

22-
- name: Run tests
23-
run: npm run test:run
25+
- name: Run tests with coverage
26+
run: npm run test:coverage
27+
28+
- name: Upload coverage to Codecov
29+
uses: codecov/codecov-action@v4
30+
with:
31+
use_oidc: true
32+
files: ./coverage/coverage-final.json
33+
flags: unittests
34+
name: openboot-web-coverage
35+
fail_ci_if_error: false
2436

2537
- name: Build
2638
run: npm run build

package-lock.json

Lines changed: 198 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@sveltejs/kit": "^2.50.1",
2121
"@sveltejs/vite-plugin-svelte": "^6.2.4",
2222
"@testing-library/svelte": "^5.3.1",
23+
"@vitest/coverage-v8": "^4.0.18",
2324
"@vitest/ui": "^4.0.18",
2425
"fuse.js": "^7.1.0",
2526
"happy-dom": "^20.6.1",

0 commit comments

Comments
 (0)