Skip to content

Commit

Permalink
nit nit
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd committed Apr 2, 2024
1 parent ca39e9d commit 88d0088
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,18 @@ jobs:
- name: Report coverage
run: |
coverage report
- name: Retrieve baseline coverage
run: |
git fetch origin main:main
baseline_coverage=$(git show main:.coverage | coverage report -m | sed -n '/TOTAL/ s/.*\s\([0-9.]*%\).*/\1/p' | sed 's/%//')
echo "$baseline_coverage" > .coverage_baseline
- name: Compare coverage with baseline
run: |
current_coverage=$(coverage report -m | sed -n '/TOTAL/ s/.*\s\([0-9.]*%\).*/\1/p' | sed 's/%//')
baseline_coverage=$(cat .coverage_baseline)
if (( current_coverage < baseline_coverage )); then
echo "Coverage decreased from $baseline_coverage% to $current_coverage%"
exit 1
fi

0 comments on commit 88d0088

Please sign in to comment.