feat(ci): add Codecov coverage reporting and badge

Add json/json-summary reporters to vitest config, upload coverage
to Codecov after test step in CI, and add coverage badge to README.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
saltbo
2026-04-12 15:07:29 -04:00
parent 33ca372bdb
commit c376f2eb1b
3 changed files with 11 additions and 0 deletions
+5
View File
@@ -25,6 +25,11 @@ jobs:
- run: npm run lint
- run: npm run typecheck
- run: npm test
- uses: codecov/codecov-action@v5
if: always()
with:
files: coverage/coverage.json
fail_ci_if_error: false
- run: mkdir -p dist
- run: npm run test:cf
+1
View File
@@ -3,6 +3,7 @@
**The open-source, S3-native file hosting platform.**
[![CI](https://github.com/saltbo/zpan/actions/workflows/ci.yml/badge.svg)](https://github.com/saltbo/zpan/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/saltbo/zpan/graph/badge.svg)](https://codecov.io/gh/saltbo/zpan)
[![Release](https://github.com/saltbo/zpan/actions/workflows/release.yml/badge.svg)](https://github.com/saltbo/zpan/actions/workflows/release.yml)
[![GitHub Release](https://img.shields.io/github/v/release/saltbo/zpan)](https://github.com/saltbo/zpan/releases/latest)
[![Docker Image](https://img.shields.io/badge/ghcr.io-saltbo%2Fzpan-blue)](https://ghcr.io/saltbo/zpan)
+5
View File
@@ -19,6 +19,11 @@ export default defineConfig({
'src/**/*.test.ts',
'src/i18n/index.ts',
],
reporter: ['text', 'json-summary', 'json'],
reporterOptions: {
'json-summary': { file: 'coverage-summary.json' },
json: { file: 'coverage.json' },
},
thresholds: {
statements: 90,
branches: 80,