We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a88c9cf commit 644fe79Copy full SHA for 644fe79
.github/workflows/ci.yaml
@@ -39,6 +39,16 @@ jobs:
39
- name: Test
40
run: CGO_ENABLED=1 go test -race -coverprofile=coverage.out ./...
41
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
+
52
- name: Build
53
run: CGO_ENABLED=1 go build -v ./cmd/peerclawd
54
0 commit comments