Skip to content

Commit

Permalink
Fix Coverage Badge
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianZaccaria committed Dec 7, 2023
1 parent 073b171 commit fff052a
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions .github/workflows/coverage-badge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ name: Coverage Badge
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
report:
Expand All @@ -24,30 +26,31 @@ jobs:
poetry config virtualenvs.create false
poetry lock --no-update
poetry install --with test
poetry show
- name: Generate coverage report
run: |
coverage run -m --source=src pytest -v tests/unit_test.py
- name: Coverage Badge
uses: tj-actions/[email protected]

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

- name: Commit files
if: steps.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: Create Pull Request
if: steps.changed_files.outputs.files_changed == 'true'
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "[Automatic] Coverage Badge Update"
# - name: Coverage Badge
# uses: tj-actions/[email protected]

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

# - name: Commit files
# if: steps.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: Create Pull Request
# if: steps.changed_files.outputs.files_changed == 'true'
# uses: peter-evans/create-pull-request@v4
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# title: "[Automatic] Coverage Badge Update"

0 comments on commit fff052a

Please sign in to comment.