Skip to content

Commit 00df52d

Browse files
committed
Update ci.yml
1 parent 9767531 commit 00df52d

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ jobs:
2323
run: |
2424
go test -v ./... -covermode=count -coverprofile=coverage.out
2525
go tool cover -func=coverage.out -o=coverage.out
26-
# sudo go test ./... -coverprofile coverage.out -covermode count
27-
# sudo go tool cover -func coverage.out
2826
2927
- name: Go Coverage Badge # Pass the `coverage.out` output to this action
3028
uses: tj-actions/coverage-badge-go@v2
@@ -50,20 +48,4 @@ jobs:
5048
uses: ad-m/github-push-action@master
5149
with:
5250
github_token: ${{ github.token }}
53-
branch: ${{ github.head_ref }}
54-
55-
- name: Quality Gate - Test coverage shall be above threshold
56-
env:
57-
TESTCOVERAGE_THRESHOLD: 10
58-
run: |
59-
echo "Quality Gate: checking test coverage is above threshold ..."
60-
echo "Threshold : $TESTCOVERAGE_THRESHOLD %"
61-
totalCoverage=`go tool cover -func=coverage.out | grep '(statements)' | grep -Eo '[0-9]+\.[0-9]+'`
62-
echo "Current test coverage : $totalCoverage %"
63-
if (( $(echo "$totalCoverage $TESTCOVERAGE_THRESHOLD" | awk '{print ($1 > $2)}') )); then
64-
echo "OK"
65-
else
66-
echo "Current test coverage is below threshold. Please add more unit tests or adjust threshold to a lower value."
67-
echo "Failed"
68-
exit 1
69-
fi
51+
branch: ${{ github.head_ref }}

0 commit comments

Comments
 (0)