Skip to content

Commit 8eecc1f

Browse files
vividcoderclaude
andcommitted
ci: adjust coverage thresholds to 5% fail and 3% warn
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 07a80f3 commit 8eecc1f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/coverage-check.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ concurrency:
1515

1616
env:
1717
# Fail the check if total coverage drops more than this percentage
18-
COVERAGE_DROP_THRESHOLD: 1.0
18+
COVERAGE_DROP_THRESHOLD: 5.0
19+
# Warn if coverage drops more than this percentage
20+
COVERAGE_WARN_THRESHOLD: 3.0
1921

2022
jobs:
2123
# Run tests on PR branch and base branch in parallel
@@ -308,14 +310,18 @@ jobs:
308310
309311
// --- Threshold check ---
310312
const threshold = parseFloat('${{ env.COVERAGE_DROP_THRESHOLD }}');
313+
const warnThreshold = parseFloat('${{ env.COVERAGE_WARN_THRESHOLD }}');
311314
let passed = true;
312315
313316
if (hasBase && coverageDrop < -threshold) {
314317
passed = false;
315318
body += `\n> [!CAUTION]\n> Line coverage dropped by **${fmtDiff(coverageDrop)}**, exceeding the allowed threshold of **-${threshold}%**.\n`;
316319
body += `> Please add tests to cover the new or modified code.\n`;
320+
} else if (hasBase && coverageDrop < -warnThreshold) {
321+
body += `\n> [!WARNING]\n> Line coverage decreased by **${fmtDiff(coverageDrop)}**, exceeding the warning threshold of **-${warnThreshold}%**.\n`;
322+
body += `> Consider adding tests to cover the new or modified code.\n`;
317323
} else if (hasBase && coverageDrop < 0) {
318-
body += `\n> [!WARNING]\n> Line coverage decreased by **${fmtDiff(coverageDrop)}**, but within the allowed threshold of **-${threshold}%**.\n`;
324+
body += `\n> [!NOTE]\n> Line coverage decreased by **${fmtDiff(coverageDrop)}**, within the allowed threshold.\n`;
319325
} else if (!hasBase) {
320326
body += `\n> [!NOTE]\n> Base branch coverage is unavailable. Only PR branch coverage is shown.\n`;
321327
} else {

0 commit comments

Comments
 (0)