mirror of
https://github.com/saltbo/zpan.git
synced 2026-08-29 00:01:42 +08:00
ci: make coverage ratchet lossless
This commit is contained in:
@@ -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
@@ -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,
|
||||
},
|
||||
}
|
||||
: {}
|
||||
|
||||
Reference in New Issue
Block a user