Skip to content

Commit 6be7527

Browse files
authored
Upload Coverage as HTML to build bucket (#1982)
Signed-off-by: Daniel Valdivia <[email protected]>
1 parent 9edeafb commit 6be7527

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/jobs.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ jobs:
13411341
echo "put together the outs for final coverage resolution"
13421342
./gocovmerge ../integration/coverage/system.out ../replication/coverage/replication.out ../sso-integration/coverage/sso-system.out ../restapi/coverage/coverage.out ../pkg/coverage/coverage-pkg.out ../operator-integration/coverage/operator-api.out > all.out
13431343
echo "Download mc for Ubuntu"
1344-
wget https://dl.min.io/client/mc/release/linux-amd64/mc
1344+
wget -q https://dl.min.io/client/mc/release/linux-amd64/mc
13451345
echo "Change the permissions to execute mc command"
13461346
chmod +x mc
13471347
echo "Create the folder to put the all.out file"
@@ -1351,16 +1351,18 @@ jobs:
13511351
echo ${{ github.event.number }}
13521352
echo ${{ github.run_id }}
13531353
./mc cp all.out play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/
1354+
go tool cover -html=all.out -o coverage.html
1355+
./mc cp coverage.html play/builds/${{ github.repository }}/${{ github.event.number }}/${{ github.run_id }}/
13541356
echo "grep to obtain the result"
13551357
go tool cover -func=all.out | grep total > tmp2
13561358
result=`cat tmp2 | awk 'END {print $3}'`
13571359
result=${result%\%}
1358-
echo "result:"
1359-
echo $result
1360-
threshold=46.1
1360+
threshold=46.6
1361+
echo "Result:"
1362+
echo "$result%"
13611363
if (( $(echo "$result >= $threshold" |bc -l) )); then
1362-
echo "It is equal or greater than threshold, passed!"
1364+
echo "It is equal or greater than threshold ($threshold%), passed!"
13631365
else
1364-
echo "It is smaller than threshold value, failed!"
1366+
echo "It is smaller than threshold ($threshold%) value, failed!"
13651367
exit 1
13661368
fi

0 commit comments

Comments
 (0)