From 6de4e86c2f43adda566f6430ed76503bf3fbd6a1 Mon Sep 17 00:00:00 2001 From: Ivan Sanchez Date: Sat, 28 Feb 2026 02:43:26 -0600 Subject: [PATCH] chore(ci): enforce minimum 85% line coverage threshold Fail CI if line coverage drops below 85%. Current coverage: 93.4%. --- .github/workflows/ci.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 424d81d..0a2794b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,18 @@ jobs: - run: bun install - - run: bun test --coverage + - name: Run tests with coverage + run: | + bun test --coverage 2>&1 | tee /tmp/coverage.txt + + - name: Check coverage threshold + run: | + COVERAGE=$(grep 'All files' /tmp/coverage.txt | awk -F'|' '{gsub(/ /, "", $3); print $3}') + echo "Line coverage: ${COVERAGE}%" + THRESHOLD=85 + if [ "$(echo "$COVERAGE < $THRESHOLD" | bc -l)" -eq 1 ]; then + echo "::error::Coverage ${COVERAGE}% is below threshold ${THRESHOLD}%" + exit 1 + fi - run: bun run build