Skip to content

Commit 945db56

Browse files
committed
Improve coverage reporting
1 parent 6a8897f commit 945db56

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: CI Pipeline
22

3+
permissions:
4+
pull-requests: write
5+
36
on:
47
push:
58
branches: [main]
@@ -52,6 +55,12 @@ jobs:
5255
- name: Run tests with coverage
5356
run: npm run test:coverage
5457

58+
- name: 'Report Coverage'
59+
# Set if: always() to also generate the report if tests are failing
60+
# Only works if you set `reportOnFailure: true` in your vite config as specified above
61+
if: always()
62+
uses: davelosert/vitest-coverage-report-action@v2
63+
5564
- name: Upload coverage report
5665
uses: actions/upload-artifact@v4
5766
with:

vitest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default defineConfig({
88
coverage: {
99
reporter: ['text', 'json-summary', 'json', 'html'],
1010
include: ['src/**/*.ts'],
11+
reportOnFailure: true,
1112
},
1213
},
1314
});

0 commit comments

Comments
 (0)