feat: add code coverage setup with Codecov integration and GitHub badge#369
Draft
feat: add code coverage setup with Codecov integration and GitHub badge#369
Conversation
Copilot
AI
changed the title
[WIP] Research code coverage setup for monorepo
feat: add code coverage setup with Codecov integration and GitHub badge
Apr 8, 2026
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.
No code coverage reporting infrastructure existed despite having a
unit:test:coveragescript — no thresholds, no CI upload, no badge.Description
Sets up Jest coverage collection, enforces thresholds, uploads reports to Codecov on every CI run, and surfaces coverage via a README badge.
What change does this PR introduce?
What is the proposed approach?
jest.config.js— Coverage configuration added:collectCoverageFrom: scopes tosrc/**/*.{ts,tsx}, excluding dev/entry-point files (App.tsx,devIndex.tsx,index.tsx,viteconfig.ts,*.d.ts)coverageReporters: ['text', 'lcov', 'json-summary']: console output + lcov for Codecov + json-summary for toolingcoverageThreshold: CI fails if coverage drops below these measured-and-conservative baselines:codecov.yml— Codecov project config:unitflag scoped tosrc/.github/workflows/test.yml— CI changes:npm run unit:test→npm run unit:test:coverageto generate the lcov report./coverage/lcov.infoviacodecov/codecov-action@v5with theunitflagCODECOV_TOKENsecret forwarded throughworkflow_call.github/workflows/lint-and-build.yml— PassesCODECOV_TOKENsecret to the reusable test workflow.README.md— Codecov badge added next to the CI badge.On the "monorepo / multi-stack" question: this repo has two test stacks (Jest unit + Cypress e2e). The industry-standard approach is to upload each as a separate flagged report to Codecov, which merges them into a unified view. This PR covers the Jest side. Cypress coverage (via
@cypress/code-coverage) can be added as a follow-up with anintegrationflag.Checklist:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
download.cypress.io/home/REDACTED/work/_temp/ghcca-node/node/bin/node node dist/index.js --exec install(dns block)If you need me to access, download, or install something from one of these locations, you can either: