Skip to content

Commit c08e6bb

Browse files
committed
Test simple coverage report in PR
1 parent 1e72696 commit c08e6bb

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,20 @@ jobs:
4040

4141
- run: yarn
4242

43-
- run: yarn test:ci
43+
- run: yarn test:ci --coverage
44+
45+
# Simple text summary
46+
- name: Coverage Report
47+
if: always()
48+
run: |
49+
echo "### Coverage Report" >> $GITHUB_STEP_SUMMARY
50+
echo '```' >> $GITHUB_STEP_SUMMARY
51+
npx c8 report --reporter=text >> $GITHUB_STEP_SUMMARY
52+
echo '```' >> $GITHUB_STEP_SUMMARY
53+
54+
# Upload HTML report
55+
- uses: actions/upload-artifact@v4
56+
if: always()
57+
with:
58+
name: coverage-report
59+
path: coverage/

vitest.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export default defineConfig({
1616
fileParallelism: true,
1717
coverage: {
1818
provider: "v8",
19+
reporter: ["text", "json-summary", "json", "html"],
20+
reportsDirectory: "./coverage",
21+
reportOnFailure: true,
1922
},
2023
},
2124
resolve: {

0 commit comments

Comments
 (0)