Upload test coverage to Codecov#377
Merged
Merged
Conversation
Collect Cobertura coverage during dotnet test and upload it to Codecov best-effort (fail_ci_if_error: false). Thread CODECOV_TOKEN to the reusable validate-task via secrets: inherit, and reference coverlet.collector in the test project. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Codecov coverage reporting to the repo’s CI pipeline by collecting Cobertura coverage during dotnet test and uploading it via the pinned codecov/codecov-action, designed to be best-effort (non-gating).
Changes:
- Add
coverlet.collectorto the test project and central package versions to enableXPlat Code Coveragecollection. - Update the reusable
validate-taskworkflow to run tests with coverage collection and upload results to Codecov. - Thread Codecov credentials through workflow callers so coverage upload can authenticate when
CODECOV_TOKENis configured.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| UtilitiesTests/UtilitiesTests.csproj | Adds coverlet.collector to enable coverage collection during test runs. |
| Directory.Packages.props | Centrally pins coverlet.collector version for consistent restore/build. |
| .github/workflows/validate-task.yml | Collects coverage in dotnet test and uploads coverage artifacts to Codecov. |
| .github/workflows/test-pull-request.yml | Passes secrets through to the reusable validation workflow for coverage upload. |
| .github/workflows/publish-release.yml | Passes secrets through to the reusable validation workflow for coverage upload during release validation. |
This was referenced Jul 9, 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.
Collect Cobertura coverage during
dotnet testand upload it to Codecov, best-effort (fail_ci_if_error: false, so a Codecov hiccup or an absent token never fails the gate).Mirrors the proven PlexCleaner pattern:
validate-task.yml:dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage, then acodecov/codecov-actionupload step.test-pull-request.ymlandpublish-release.yml: passsecrets: inheriton thevalidate-taskcall soCODECOV_TOKENthreads through to the unit-test job.coverlet.collectorinUtilitiesTests(andDirectory.Packages.props).Maintainer action required: add a
CODECOV_TOKENsecret to the repo Actions secrets for uploads to authenticate. Until then, uploads are simply skipped and CI stays green.