.github/workflows/scripts/run-tests.sh
raw| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -euo pipefail |
| 4 | |
| 5 | echo 'mode: atomic' > coverage.txt |
| 6 | GOEXPERIMENT=synctest go test -covermode=atomic -coverprofile=coverage.txt.tmp -coverpkg=./... -v -race ./... |
| 7 | cat coverage.txt.tmp | grep -v -E "/generated/|/cmd/" > coverage.txt |
| 8 | rm coverage.txt.tmp |
| 9 | COVERAGE=$(go tool cover -func=coverage.txt | tail -1 | grep -Eo '[0-9]+\.[0-9]') |
| 10 | echo "coverage: $COVERAGE% of statements" |