ci: collect + upload coverage to Codecov#32
Conversation
Enable `--collect:"XPlat Code Coverage"` on the unit test run (coverlet.collector is already a dev dependency in both test projects) and upload the produced Cobertura XML(s) to Codecov non-blockingly. Requires CODECOV_TOKEN to be set as a repo secret. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
WalkthroughThe GitHub Actions test workflow is modified to collect code coverage during unit test execution and upload the coverage results to Codecov. The test step now includes XPlat code coverage collection with configured output directory, and a new Codecov upload step is added with pinned action version and non-blocking CI failure handling. ChangesCode Coverage Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/test.yml:
- Line 94: The workflow comment for the Codecov action is incorrect: the action
is pinned to commit e79a6962e0d4c0c17b229090214935d2e33f8354 but annotated as “#
v6.0.1”; fix this by either changing the pinned reference to the commit that
actually corresponds to tag v6.0.1 (cddd853df119a48c5be31a973f8cd97e12e35e16) or
by removing/updating the trailing version comment to match the pinned commit
(i.e., update the comment on the uses:
codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 line to the
correct tag/commit or change the pin to
`@cddd853df119a48c5be31a973f8cd97e12e35e16`).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: aead45c5-c2af-4e3a-a43c-91a6547db6ca
📒 Files selected for processing (1)
.github/workflows/test.yml
| # outage cannot break CI. | ||
| - name: Upload coverage to Codecov | ||
| # codecov/codecov-action v6.0.1 | ||
| uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify codecov-action SHA matches v6.0.1 and check for latest releases
# Check if the SHA matches the v6.0.1 tag
echo "=== Checking if SHA e79a6962e0d4c0c17b229090214935d2e33f8354 matches v6.0.1 ==="
gh api repos/codecov/codecov-action/git/ref/tags/v6.0.1 --jq '.object.sha'
# List recent releases to see if newer versions exist
echo -e "\n=== Recent releases of codecov/codecov-action ==="
gh api repos/codecov/codecov-action/releases --jq '.[:5] | .[] | "\(.tag_name) - \(.published_at) - \(.name)"'
# Check what commit the SHA points to
echo -e "\n=== Commit details for SHA e79a6962e0d4c0c17b229090214935d2e33f8354 ==="
gh api repos/codecov/codecov-action/commits/e79a6962e0d4c0c17b229090214935d2e33f8354 --jq '{sha: .sha, message: .commit.message, date: .commit.committer.date}'Repository: agentruntimecontrolprotocol/fsharp-sdk
Length of output: 645
Fix the mismatched v6.0.1 version annotation for codecov/codecov-action.
.github/workflows/test.yml:94pinscodecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354, but thev6.0.1tag points tocddd853df119a48c5be31a973f8cd97e12e35e16, so# v6.0.1is inaccurate—either pin thev6.0.1tag commit or correct/remove the version comment.- No newer release than
v6.0.1appeared in the recent releases returned.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/test.yml at line 94, The workflow comment for the Codecov
action is incorrect: the action is pinned to commit
e79a6962e0d4c0c17b229090214935d2e33f8354 but annotated as “# v6.0.1”; fix this
by either changing the pinned reference to the commit that actually corresponds
to tag v6.0.1 (cddd853df119a48c5be31a973f8cd97e12e35e16) or by removing/updating
the trailing version comment to match the pinned commit (i.e., update the
comment on the uses:
codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 line to the
correct tag/commit or change the pin to
`@cddd853df119a48c5be31a973f8cd97e12e35e16`).
Summary
--collect:"XPlat Code Coverage"on the unit test run (the test projects already referencecoverlet.collector).TestResults/to Codecov.fail_ci_if_error: falseso a Codecov outage cannot break CI.Pre-merge action required
CODECOV_TOKENas a repo secret (gh secret set CODECOV_TOKEN --repo agentruntimecontrolprotocol/fsharp-sdk).Test plan
main.🤖 Generated with Claude Code
Summary by CodeRabbit