Created
November 16, 2022 16:41
-
-
Save strategicpause/9e430375f0c47cdbf5a53934621bd131 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEST_COVERAGE_THRESHOLD=90.0 | |
coverage: | |
@TEST_COVERAGE=$(shell go test -coverpkg ./... | grep coverage | grep -Eo '[0-9]+\.[0-9]+'); \ | |
if (( $(echo "$$TEST_COVERAGE $(TEST_COVERAGE_THRESHOLD)" | awk '{print ($1 > $2)}') )); then \ | |
exit 0; \ | |
else \ | |
echo "Current test coverage $$TEST_COVERAGE is below threshold of $(TEST_COVERAGE_THRESHOLD)."; \ | |
exit 1; \ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment