ci: make coverage ratchet lossless

This commit is contained in:
saltbo
2026-08-05 10:09:52 -04:00
parent 499939981c
commit 85578193ce
2 changed files with 15 additions and 6 deletions
+9
View File
@@ -94,6 +94,7 @@ jobs:
name: vitest-coverage-unit-${{ matrix.shard }}
path: .vitest-reports/unit-${{ matrix.shard }}.blob
include-hidden-files: true
if-no-files-found: error
retention-days: 1
integration:
@@ -122,6 +123,7 @@ jobs:
name: vitest-coverage-integration-${{ matrix.shard }}
path: .vitest-reports/integration-${{ matrix.shard }}.blob
include-hidden-files: true
if-no-files-found: error
retention-days: 1
coverage:
@@ -142,6 +144,13 @@ jobs:
pattern: vitest-coverage-*
path: .vitest-reports
merge-multiple: true
- name: Verify every coverage shard is present
run: |
test -f .vitest-reports/unit-1.blob
test -f .vitest-reports/unit-2.blob
test -f .vitest-reports/integration-1.blob
test -f .vitest-reports/integration-2.blob
test "$(find .vitest-reports -type f -name '*.blob' | wc -l)" -eq 4
- name: Merge coverage and enforce thresholds
env:
COVERAGE_ENFORCE: '1'
+6 -6
View File
@@ -39,13 +39,13 @@ const coverageConfig = {
const coverageGate =
process.env.COVERAGE_ENFORCE === '1'
? {
// Integer floors of the merged CI shard baseline. Keep this as a ratchet:
// production growth must preserve or improve the repository-wide result.
// Lock the merged CI baseline by maximum uncovered items. Unlike rounded
// percentages, negative thresholds cannot hide a small coverage regression.
thresholds: {
statements: 86,
branches: 75,
functions: 66,
lines: 94,
statements: -2099,
branches: -2869,
functions: -1924,
lines: -717,
},
}
: {}