Skip to content

Add code coverage tracking and badge generation - #9

Merged
callicles merged 4 commits into
mainfrom
claude/add-code-coverage-8F2WK
Feb 26, 2026
Merged

Add code coverage tracking and badge generation#9
callicles merged 4 commits into
mainfrom
claude/add-code-coverage-8F2WK

Conversation

@callicles

Copy link
Copy Markdown
Contributor

Summary

This PR adds automated code coverage tracking and badge generation to the CI/CD pipeline. Coverage reports are now generated on every push to main and published to a dedicated badges branch for display in the README.

Key Changes

  • CI/CD Pipeline: Updated GitHub Actions workflow to generate coverage reports and create/push a coverage badge

    • Added permissions: contents: write to allow pushing to the badges branch
    • Changed unit test step to run with coverage (pnpm test:unit:coverage)
    • Added badge generation step that reads coverage summary and creates an SVG badge with color-coded percentage
    • Added step to push the badge to a separate badges branch using git
  • Vitest Configuration: Added coverage configuration to vitest.config.ts

    • Configured v8 as the coverage provider
    • Set up json-summary reporter for parsing coverage data
    • Defined coverage scope to include lib, app source files while excluding tests and node_modules
  • Package Scripts: Added new npm script test:unit:coverage to run unit tests with coverage reporting

  • Dependencies: Added @vitest/coverage-v8 dev dependency for coverage support

  • Documentation: Added coverage badge to README.md that displays the current coverage percentage

  • Git Configuration: Updated .gitignore to exclude the coverage/ directory

Implementation Details

The coverage badge uses a color-coded system:

  • Green (#4c1) for ≥90% coverage
  • Yellow-green (#a3c51c) for ≥80%
  • Yellow (#dfb317) for ≥70%
  • Orange (#fe7d37) for ≥60%
  • Red (#e05d44) for <60%

The badge is generated as an SVG and pushed to a separate badges branch to avoid cluttering the main branch history while keeping it accessible via raw GitHub URLs.

https://claude.ai/code/session_014crXzSoLbS7aqMztGQEKNy

- Install @vitest/coverage-v8 for V8-based coverage instrumentation
- Configure vitest coverage to report on lib/ and app/ source files
- Add test:unit:coverage script to package.json
- Create coverage.yml workflow that generates an SVG badge and pushes
  it to the badges branch on every push to main
- Add coverage badge to README.md referencing the raw SVG on GitHub
- Add coverage/ to .gitignore

https://claude.ai/code/session_014crXzSoLbS7aqMztGQEKNy
Move coverage generation and badge push from a separate coverage.yml
into the test-unit job in ci.yml. Badge steps only run on push to main.

https://claude.ai/code/session_014crXzSoLbS7aqMztGQEKNy
- Strip badge generation and git push from test-unit job (keep coverage run only)
- Remove unneeded permissions: contents: write
- Add test-e2e job with postgres, Playwright chromium install, and db migration

https://claude.ai/code/session_014crXzSoLbS7aqMztGQEKNy
@vercel

vercel Bot commented Feb 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v0-cla-bot-application Ready Ready Preview, Comment, Open in v0 Feb 26, 2026 0:44am

Request Review

Comment thread .github/workflows/ci.yml Fixed
@callicles
callicles merged commit 72f4545 into main Feb 26, 2026
11 checks passed
@callicles
callicles deleted the claude/add-code-coverage-8F2WK branch February 26, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants