From 1bf74a82a779ea7dd1d94f4fd2475520f5912536 Mon Sep 17 00:00:00 2001 From: crazy hugsy Date: Mon, 7 Nov 2022 22:54:08 -0800 Subject: [PATCH] [CI] Refusing anything below 70% of coverage --- .github/workflows/run-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5d10553dd..8e207afd3 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -78,9 +78,11 @@ jobs: if: matrix.os == 'ubuntu-22.04' env: ALLOWED_MARGIN: 0.05 + MIN_COVERAGE: 70 run: | current_score=$(curl --silent https://hugsy.github.io/gef/coverage/gef_py.html | grep pc_cov | sed 's?.*\([^%]*\)%?\1?g') bash scripts/generate-coverage-docs.sh new_score=$(cat docs/coverage/gef_py.html | grep pc_cov | sed 's?.*\([^%]*\)%?\1?g') echo "New coverage score: ${new_score}% (current ${current_score}%)" - python${{ env.PY_VER }} -c "( ${new_score} < ( ${current_score} - ${{ env.ALLOWED_MARGIN}} ) ) and exit(1)" + python${{ env.PY_VER }} -c "( ${new_score} < ${{ env.MIN_COVERAGE}} ) and exit(1)" + python${{ env.PY_VER }} -c "( ${new_score} < ( ${current_score} - ${{ env.ALLOWED_MARGIN}} ) ) and exit(2)"