Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd committed Apr 2, 2024
1 parent 1ea535d commit bfb39d5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,20 @@ jobs:
run: |
git fetch origin main:main
baseline_coverage=$(git show main:coverage.json | grep -o '"totals": {[^}]*' | grep -o '"percent_covered": [0-9.]*' | awk -F ': ' '{print $2}')
echo "BARBARBAR $baseline_coverage"
echo "$baseline_coverage" > .coverage_baseline
- name: Compare coverage with baseline
run: |
current_coverage=$(coverage report -m | grep TOTAL | awk '{print int($4)}' | sed 's/%//')
baseline_coverage=$(cat .coverage_baseline)
baseline_coverage=$(printf "%.0f" "$baseline_coverage")
echo "FOOFOOFOO from $baseline_coverage% to $current_coverage%"
if [[ "$current_coverage" -lt "$baseline_coverage" ]]; then
echo "Coverage decreased from $baseline_coverage% to $current_coverage%"
exit 1
else
echo "Coverage didn't decrease. Committing new coverage.json."
coverage json
git add coverage.json
git commit -m "Update coverage.json"
git push origin ${{ github.head_ref }}
fi

0 comments on commit bfb39d5

Please sign in to comment.