Skip to content

Commit

Permalink
add coverage reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhouweling committed Dec 1, 2024
1 parent 027a845 commit 006d008
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Test

permissions:
checks: write
pull-requests: write

on:
push:
branches:
Expand All @@ -17,6 +13,11 @@ jobs:
name: Run Test
runs-on: ubuntu-latest

permissions:
contents: read
checks: write
pull-requests: write

steps:
- name: Check out Git repository
uses: actions/checkout@v4
Expand All @@ -37,10 +38,15 @@ jobs:
run: npm run build:generate-types

- name: Run test
run: npm run test
run: npx vitest --coverage.enabled true

- name: Publish test results
if: always()
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: |
test-results/**/*.xml
- name: Report Coverage
if: always()
uses: davelosert/vitest-coverage-report-action@v2
4 changes: 4 additions & 0 deletions vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ export default defineConfig({
outputFile: {
junit: "./test-results/junit-report.xml",
},
coverage: {
reporter: ["text", "json-summary", "json"],
reportOnFailure: true,
},
},
});

0 comments on commit 006d008

Please sign in to comment.