-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test.yml coverage reports xml and json
- Loading branch information
Showing
1 changed file
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
@@ -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". | ||
|