Skip to content

Commit

Permalink
[CI] Refusing anything below 70% of coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
hugsy committed Nov 8, 2022
1 parent ec83f44 commit 1bf74a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/run-tests.yml
Expand Up @@ -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?.*<span class="pc_cov">\([^%]*\)%</span>?\1?g')
bash scripts/generate-coverage-docs.sh
new_score=$(cat docs/coverage/gef_py.html | grep pc_cov | sed 's?.*<span class="pc_cov">\([^%]*\)%</span>?\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)"

0 comments on commit 1bf74a8

Please sign in to comment.