Skip to content

chore(CI): cache coverage baseline from main for regression checks#4875

Merged
fernandolins merged 3 commits into
mainfrom
ci/coverage-baseline-cache
May 22, 2026
Merged

chore(CI): cache coverage baseline from main for regression checks#4875
fernandolins merged 3 commits into
mainfrom
ci/coverage-baseline-cache

Conversation

@fernandolins
Copy link
Copy Markdown
Contributor

Linked issue

Refs #4874

Summary / motivation

Stores the coverage results from every push to main in a GitHub Actions
cache (coverage-baseline-linux-{sha}). This is the foundation for a
follow-up PR that will compare PR coverage against this baseline and fail
if any stack regresses.

No behavior change for PRs yet — the baseline is only saved, not used.

Before / after behavior

Before: no coverage data persisted between CI runs.
After: each push to main saves out/coverage/ as a cache entry, keyed
by commit SHA, retrievable by prefix coverage-baseline-linux-.

Comment thread .github/workflows/ci.yml
@fernandolins fernandolins merged commit 3ca006d into main May 22, 2026
6 checks passed
@fernandolins fernandolins deleted the ci/coverage-baseline-cache branch May 22, 2026 19:01
fernandolins added a commit that referenced this pull request May 25, 2026
## Linked issue

Closes #4874

## Summary / motivation

Adds `tools/coverage/check-coverage-regression.py` to compare line
coverage percentages from the current PR against the baseline saved from
main (introduced in #4875). If any stack regresses beyond the
configured tolerance (0.10%), the CI fails with a clear message showing
the delta.

Stacks checked: Rust, python-pylib, python-qt, TypeScript.

## How to test

Try to add some new code without any tests. The Ci must fail.

## Before / after behavior

Before: no signal when a PR reduces coverage below the current main
level.
After: CI fails on `Check coverage regression` with output like:
```
[rust] REGRESSION: 62.64% -> 61.00% (delta: -1.64%, tolerance: 0.10%)
1 stack(s) with coverage regression: rust
```
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.

2 participants