Skip to content

Add code coverage CI (cargo-llvm-cov + Codecov)#12

Merged
dkijania merged 1 commit into
mainfrom
add-code-coverage-ci
May 19, 2026
Merged

Add code coverage CI (cargo-llvm-cov + Codecov)#12
dkijania merged 1 commit into
mainfrom
add-code-coverage-ci

Conversation

@dkijania

Copy link
Copy Markdown
Member

Summary

New `.github/workflows/coverage.yml` running `cargo llvm-cov` against each in-tree Rust crate (`release-manager`, `mina-bench-upload`, `buildkite-cache-manager`) and uploading LCOV reports to Codecov with per-crate flags.

What's in the workflow

  • Matrix per crate — each crate is its own job so a single failure doesn't poison the others. Uses `fail-fast: false`.
  • Per-crate Codecov flags — PRs will get coverage deltas separated by crate in the Codecov comment.
  • Path-filtered — only fires when files in `release-manager/`, `mina-bench-upload/`, `buildkite-cache-manager/`, or the workflow itself change.
  • Caching — uses `Swatinem/rust-cache@v2` keyed on the crate name to keep repeat-PR turnaround under a minute after the first run.
  • `fail_ci_if_error: false` — coverage is advisory while we calibrate. The workflow won't block PRs.

codecov.yml

Sits at the repo root. Defines:

  • Per-crate flags + paths so Codecov groups coverage by crate.
  • Project threshold: `target: auto, threshold: 1%` — allows ~1% drift on small refactors before flagging.
  • Patch threshold: `target: 70%` on new code in a PR.
  • Both with `if_ci_failed: ignore` so the build stays green while we're still calibrating the baselines.
  • Ignores the three git submodules (their coverage reports live in their own repos) and the usual fixtures/target directories.

Once each crate has a few weeks of trend data we can tighten these into real gates.

Codecov token

The workflow references `secrets.CODECOV_TOKEN` but tolerates its absence — Codecov accepts uploads from public-repo PRs token-free. Add the secret later if uploads start being rate-limited.

Not in this PR

  • README coverage badges — would be noise until Codecov has ingested a run. Add in a follow-up once the first workflow completes successfully on `main`.
  • Submodule coverage — `deb-toolkit`, `deb-s3`, `dhall-buildkite` will need coverage wired up in their own repos.

Test plan

  • On this PR, the new workflow runs three matrix jobs and each produces an `lcov.info` upload to Codecov.
  • Codecov bot leaves a PR comment with per-crate coverage numbers.
  • After merge, `main`'s coverage trend appears at `codecov.io/gh/MinaProtocol/mina-release-toolkit`.

🤖 Generated with Claude Code

Adds a new GitHub Actions workflow that runs `cargo llvm-cov` against
each in-tree Rust crate (`release-manager`, `mina-bench-upload`,
`buildkite-cache-manager`) and uploads LCOV reports to Codecov.

Matrix-per-crate setup:
  * Each crate runs as its own job so one crate's failure doesn't
    poison the others.
  * Each upload is tagged with a Codecov *flag* matching the crate
    name, so PRs see per-crate coverage deltas in the comment.
  * `fail-fast: false` and `fail_ci_if_error: false` keep the workflow
    advisory — coverage is observation, not a gate (yet).

`codecov.yml` defines the per-crate flags + paths, ignores the three
submodules (their coverage lives in their own repos), and sets the
informational project / patch thresholds:

  * project: target auto, threshold 1% (allows small drift)
  * patch:   target 70% on new code

Both with `if_ci_failed: ignore` so the build stays green while we're
still calibrating. Once we have a few weeks of trend data per crate
we can tighten these to enforceable thresholds.

The Codecov action accepts uploads from public-repo PRs without a
token. A `CODECOV_TOKEN` repo secret can be added later to avoid rate
limits at higher volume.

Per-crate README badges are intentionally not added here — they'd be
noise until Codecov has actually ingested a run. Add them in a
follow-up once data lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dkijania dkijania mentioned this pull request May 19, 2026
2 tasks
@dkijania
dkijania merged commit 5b5ddce into main May 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant