From a1b4f009eb0fc8c19f8c6652997fb03d27b97a33 Mon Sep 17 00:00:00 2001 From: crazy hugsy Date: Mon, 7 Nov 2022 22:01:29 -0800 Subject: [PATCH] [ci] added a margin for the coverage reduction test --- .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 a2fef92d0..5d10553dd 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -76,9 +76,11 @@ jobs: - name: Run test coverage if: matrix.os == 'ubuntu-22.04' + env: + ALLOWED_MARGIN: 0.05 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} ) or exit(1)" + python${{ env.PY_VER }} -c "( ${new_score} < ( ${current_score} - ${{ env.ALLOWED_MARGIN}} ) ) and exit(1)"