Skip to content

Commit

Permalink
Use GH action to publish coverage badge.
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandMacDoland committed Dec 5, 2024
1 parent 3cabc34 commit fe2a749
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/test_fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,34 @@ jobs:
- name: Run fast tests
run: |
hatch -v run test -m "not slow"
- name: Run coverage
run: |
coverage run ...
coverage report -m
- name: Coverage Badge
uses: tj-actions/coverage-badge-py@v2

- name: Verify Changed files
uses: tj-actions/verify-changed-files@v16
id: verify-changed-files
with:
files: coverage.svg

- name: Commit files
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add coverage.svg
git commit -m "Updated coverage.svg"
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.github_token }}
branch: ${{ github.ref }}

publish:
name: Publish to PyPI
Expand Down

0 comments on commit fe2a749

Please sign in to comment.