Add a coverage job and badge - #9
Merged
Merged
Conversation
This was referenced Aug 16, 2026
Merged
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 CI is the strongest thing in this repo and nothing surfaced it. This adds a coverage job and a badge, plus a paragraph in the README that says out loud what the matrix already does.
The scoping problem solves itself
CADENCE_HAS_CUDAcomes from__has_include(<cuda_runtime.h>)inplatform.h, so on a runner with no CUDA toolkit every device path is preprocessed away before gcov sees it. That means no gcovr filter gymnastics and, more importantly, no dishonest denominator: the figure is what the no-GPU tests genuinely reach, not one diluted by lines only a GPU could execute. Those lines are compile-checked by thecudajob in the same run and exercised bycadence_device_testson real hardware.The number, measured in advance
Run locally against
mainwith the same configuration the job uses:89.4% lines, 98.7% functions. The two soft spots are honest ones:
config.his environment-override parsing that a test would have tosetenvits way through, andreport.h's gap is almost entirelyWriteSummary, which #8 covers.The gate is set below the number, deliberately
--fail-under-line 85against a current 89.4%. A threshold pinned to the high-water mark turns every honest refactor into a coverage failure; this job is here to catch a regression, not to make the number a ratchet. The gate is what fails a bad change — Codecov is presentation, sofail_ci_if_error: falsekeeps a third-party outage from turning the job red.The number is also written to
$GITHUB_STEP_SUMMARY, so it is readable on the run page without opening a log or depending on Codecov at all.Needs you before merging
CODECOV_TOKENto Actions secrets.Until then the job runs and gates correctly, but the README badge will read "unknown" rather than a percentage. Worth holding the merge until the token is in, or merging now and accepting a grey badge for a day — your call.