ci: add Codecov coverage upload and badge#307
Merged
Conversation
Collect Cobertura coverage in CI via the existing coverlet.collector and upload it to Codecov. Add a coverlet.runsettings that scopes coverage to the shipped GoogleMapsApi assemblies, and add a Codecov badge to the README.
🔬 TestGlance✅ 249 passed across 1 job — 95.8% · ⏱️ 9.7s
🟡 build — details✅ 249 passed · ⏭️ 11 skipped vs
Updated 2026-06-15T19:58:08.391Z |
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
Publish test coverage to Codecov so PR reviewers get an inline coverage heatmap, and add a coverage badge to the README. No new test packages were needed —
coverlet.collectorwas already referenced in both test projects.Related issue
n/a
Changes
codecov/codecov-action(pinned to a commit SHA), running withif: always()so the heatmap uploads even on test failure.coverlet.runsettingsscoping coverage to the shippedGoogleMapsApiandGoogleMapsApi.Extensions.DependencyInjectionassemblies (excludes test/sample/benchmark code).Test plan
dotnet test ... --collect:"XPlat Code Coverage" --settings coverlet.runsettingslocally; acoverage.cobertura.xmlis produced and contains only the two shipped assemblies.Important
Requires a
CODECOV_TOKENrepository secret before the upload step works in CI; the badge renders after the first upload tomaster.Checklist
dotnet formathas been run.dotnet testpasses locally (with a validGOOGLE_API_KEYfor integration tests).