Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,22 @@ jobs:
with:
go-version-file: go.mod
cache: true
- run: go test ./...

- name: Run tests
run: go test -v -coverprofile=coverage.out ./...

- name: Show coverage report
run: go tool cover -func=coverage.out

- name: Enforce 60% coverage threshold
run: |
COVERAGE=$(go tool cover -func=coverage.out | grep '^total:' | awk '{print $3}' | tr -d '%')
echo "Total coverage: ${COVERAGE}%"
if awk "BEGIN { exit !($COVERAGE < 60) }"; then
echo "FAIL: coverage ${COVERAGE}% is below the required 60%"
exit 1
fi
echo "OK: coverage ${COVERAGE}% meets the 60% threshold"

build:
name: Build
Expand Down
Loading