Skip to content

Commit

Permalink
test.yml coverage reports xml and json
Browse files Browse the repository at this point in the history
  • Loading branch information
kimpham54 authored Nov 15, 2024
1 parent af8e967 commit d8240da
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
python -m coverage run -p -m pytest src/jp2_remediator/tests/unit
python -m coverage combine
python -m coverage report -m --skip-covered --fail-under=85
python -m coverage xml
python -m coverage json
# Fetch base branch for comparison (e.g., main)
Expand All @@ -66,17 +67,17 @@ jobs:
run: |
git checkout main
python -m coverage run -p -m pytest src/jp2_remediator/tests/unit
python -m coverage json -o coverage-base.json
python -m coverage xml -o coverage-base.xml
git checkout -
diff-cover --compare-branch=main coverage.json --fail-under=85
diff-cover --compare-branch=main coverage.xml --fail-under=85
- name: "Combine"
- name: Combine coverage percentage totals
run: |
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY
- name: "Make badge"
- name: Make badge
uses: schneegans/[email protected]
with:
# GIST_TOKEN is a GitHub personal access token with scope "gist".
Expand Down

0 comments on commit d8240da

Please sign in to comment.