File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -27,13 +27,19 @@ jobs:
27
27
run : go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
28
28
29
29
# Run tests with nice formatting. Save the original log in /tmp/gotest.log
30
- - name : Run tests
30
+ - name : Run tests and Check Coverage
31
31
run : |
32
32
set -euo pipefail
33
33
go test -json -race -covermode=atomic -coverprofile=coverage.out ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
34
34
COVERAGE=$(cat /tmp/gotest.log | sed -nr "s/.*coverage:.([0-9.]+).*/\1/p" | uniq)
35
35
echo "COVERAGE=${COVERAGE}" >> $GITHUB_ENV
36
- echo "Coverage is: ${COVERAGE}%"
36
+
37
+ - name : Check coverage tolerance
38
+ if : ${{ env.COVERAGE < 80 }}
39
+ uses : actions/github-script@v3
40
+ with :
41
+ script : |
42
+ core.setFailed('Coverage test below tolerance')
37
43
38
44
- name : Update coverage badge
39
45
uses : cybercinch/dynamic-badges-action@master
You can’t perform that action at this time.
0 commit comments