Skip to content

Commit

Permalink
Adds pytest coverage comment/badge to GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaroberts committed Feb 21, 2024
1 parent b2bec42 commit ccb57eb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build_and_test_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ccb57eb

Please sign in to comment.