Add code coverage tracking and badge generation - #9
Merged
Conversation
- 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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Restricts GITHUB_TOKEN to read-only as a security best practice. https://claude.ai/code/session_014crXzSoLbS7aqMztGQEKNy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
badgesbranch for display in the README.Key Changes
CI/CD Pipeline: Updated GitHub Actions workflow to generate coverage reports and create/push a coverage badge
permissions: contents: writeto allow pushing to the badges branchpnpm test:unit:coverage)badgesbranch using gitVitest Configuration: Added coverage configuration to
vitest.config.tsPackage Scripts: Added new npm script
test:unit:coverageto run unit tests with coverage reportingDependencies: Added
@vitest/coverage-v8dev dependency for coverage supportDocumentation: Added coverage badge to README.md that displays the current coverage percentage
Git Configuration: Updated
.gitignoreto exclude thecoverage/directoryImplementation Details
The coverage badge uses a color-coded system:
The badge is generated as an SVG and pushed to a separate
badgesbranch to avoid cluttering the main branch history while keeping it accessible via raw GitHub URLs.https://claude.ai/code/session_014crXzSoLbS7aqMztGQEKNy