-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds pytest coverage comment/badge to GHA
- Loading branch information
1 parent
b2bec42
commit ccb57eb
Showing
1 changed file
with
21 additions
and
0 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 |
---|---|---|
|
@@ -69,3 +69,24 @@ jobs: | |
ls ./output | ||
# assert DICOM files exist | ||
[ -f "./output/IM_0001.dcm" ] && echo "Output DICOM file exists" || exit 1 | ||
- name: Build pytest coverage file | ||
run: | | ||
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=nii2dcm tests/ | tee pytest-coverage.txt ; echo $? | ||
- name: Pytest coverage comment | ||
uses: MishaKav/pytest-coverage-comment@main | ||
with: | ||
pytest-coverage-path: ./pytest-coverage.txt | ||
junitxml-path: ./pytest.xml | ||
|
||
- name: Update Coverage Badge | ||
uses: schneegans/[email protected] | ||
with: | ||
auth: ${{ secrets.PYTEST_COVERAGE_COMMENT }} | ||
gistID: 57ef8057d04f67dbe6e64df410b83079 | ||
filename: nii2dcm-pytest-coverage-comment.json | ||
label: Coverage Report | ||
message: ${{ steps.coverageComment.outputs.coverage }} | ||
color: ${{ steps.coverageComment.outputs.color }} | ||
namedLogo: python |