test: add tests for handler, email, cmd/server, version and enforce 80% coverage
This commit is contained in:
@@ -49,6 +49,11 @@ jobs:
|
||||
- name: go test -race
|
||||
run: go test -race -count=1 ./...
|
||||
|
||||
- name: Check coverage threshold
|
||||
run: |
|
||||
go test -coverprofile=coverage.out ./internal/... ./pkg/...
|
||||
go tool cover -func=coverage.out | grep '^total:' | python3 -c "import sys; pct=float(sys.stdin.read().split()[2].rstrip('%')); sys.exit(0 if pct >= 80 else 1)" || (echo "ERROR: coverage < 80%"; exit 1)
|
||||
|
||||
- name: go test ./examples
|
||||
run: go build ./examples/...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user