File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ name: Coverage Check
33on :
44 pull_request :
55
6+ concurrency :
7+ group : coverage-${{ github.event.pull_request.number }}
8+ cancel-in-progress : true
9+
610env :
711 COVERAGE_SENSITIVITY_PERCENT : 1
812 MAINNET_RPC : ${{ secrets.MAINNET_RPC }}
@@ -101,11 +105,10 @@ jobs:
101105 else
102106 old=0
103107 fi
104- # Floor decimals to integer for comparison
105- old_int=${old%.*}
106- new=$(( ${{ steps.new-coverage.outputs.total-coverage }} + ${{ env.COVERAGE_SENSITIVITY_PERCENT }} ))
107- if [ "$new" -lt "$old_int" ]; then
108- echo "Coverage decreased from $old_int to $new"
108+ new_total=${{ steps.new-coverage.outputs.total-coverage }}
109+ new=$(awk -v a="$new_total" -v b="${{ env.COVERAGE_SENSITIVITY_PERCENT }}" 'BEGIN{printf "%.2f", a+b}')
110+ if awk "BEGIN {exit !($new < $old)}"; then
111+ echo "Coverage decreased from $old to $new"
109112 exit 1
110113 fi
111114 mv lcovNew.info coverage.info
You can’t perform that action at this time.
0 commit comments