Skip to content

Commit

Permalink
[ci] added a margin for the coverage reduction test
Browse files Browse the repository at this point in the history
  • Loading branch information
hugsy committed Nov 8, 2022
1 parent 50e54e0 commit a1b4f00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/run-tests.yml
Expand Up @@ -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?.*<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} ) or exit(1)"
python${{ env.PY_VER }} -c "( ${new_score} < ( ${current_score} - ${{ env.ALLOWED_MARGIN}} ) ) and exit(1)"

0 comments on commit a1b4f00

Please sign in to comment.