Skip to content

Commit 644fe79

Browse files
gcmsgclaude
andcommitted
ci: add 70% coverage threshold gate
Phase 17 Batch 5: Fail CI if test coverage drops below 70%. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a88c9cf commit 644fe79

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ jobs:
3939
- name: Test
4040
run: CGO_ENABLED=1 go test -race -coverprofile=coverage.out ./...
4141

42+
- name: Check coverage
43+
run: |
44+
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print substr($3, 1, length($3)-1)}')
45+
THRESHOLD=70
46+
echo "Coverage: ${COVERAGE}% (threshold: ${THRESHOLD}%)"
47+
if [ "$(echo "$COVERAGE < $THRESHOLD" | bc -l)" -eq 1 ]; then
48+
echo "::error::Coverage ${COVERAGE}% is below threshold ${THRESHOLD}%"
49+
exit 1
50+
fi
51+
4252
- name: Build
4353
run: CGO_ENABLED=1 go build -v ./cmd/peerclawd
4454

0 commit comments

Comments
 (0)