ci: fix Codecov uploads (token + scope coverage to the app package)#317
Merged
Conversation
The README coverage badge was frozen at a stale value because Codecov rejected
every upload from the protected main branch: the codecov-action ran without a
token ("Token required because branch is protected") and, with no
fail_ci_if_error, the step failed silently while the job stayed green. Real
coverage is ~70% on modules/ (84% counting the test tree), not the badge's value.
- Pass token: ${{ secrets.CODECOV_TOKEN }} so uploads from main succeed again.
- Measure --cov=modules (the application package) instead of --cov=. so the
number reflects app code rather than being inflated by the tests/ tree.
- Add a minimal codecov.yml: informational statuses (no PR gating on this
single-maintainer project) and an ignore list for tests/scripts/docs.
Requires the CODECOV_TOKEN repository secret (added separately).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The v5 action warns 'Unexpected input file' and ignores it, falling back to auto-search. Use the correct 'files:' key so the coverage.xml path is explicit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #317 +/- ##
===========================================
+ Coverage 38.41% 70.39% +31.97%
===========================================
Files 69 49 -20
Lines 8981 11244 +2263
===========================================
+ Hits 3450 7915 +4465
+ Misses 5531 3329 -2202
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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.
The README coverage badge was stuck at a stale ~38% that matched no real measurement. Root cause: Codecov rejected every upload from the protected
mainbranch —The
codecov-actionran without a token, and with nofail_ci_if_errorthe upload step failed silently while the job stayed green, so the badge froze at the last successful upload (months old).Real coverage today: ~70% over
modules/(84% if you count thetests/tree, which--cov=.was folding in). So this is a broken-badge problem, not a low-coverage problem.Changes
token: ${{ secrets.CODECOV_TOKEN }}on the codecov-action so uploads frommainsucceed again. (CODECOV_TOKENrepo secret added separately.)fail_ci_if_errorstaysfalseso a transient Codecov outage never blocks a release.--cov=modulesinstead of--cov=.— measure the application package, not the whole repo (thetests/tree runs at ~100% and was inflating the number). The badge will report the honest ~70%.codecov.yml(new): informational statuses (no PR gating on a single-maintainer project) + an ignore list fortests/scripts/docs.After this merges, the next CI run on
mainuploads successfully and the badge updates to the real number.🤖 Generated with Claude Code