Skip to content

update coverage workflow #8

update coverage workflow

update coverage workflow #8

name: Update code coverage reports and badge
on:
push:
branches:
main
jobs:
update_coverage:
name: "Update Coverage Reports and Badge"
runs-on: ubuntu-latest
steps:
- name: "Checkout Repository"
uses: actions/checkout@v2
- name: "Set up Python"
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: "Install Dependencies"
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
- name: "Run Coverage and Generate Badge"
run: |
pytest .
coverage report
coverage xml
coverage html
genbadge coverage --input-file coverage.xml
- name: "Commit and Push Changes"
run: |
git config user.email "${{ github.run_id }}+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add coverage.xml htmlcov/* reports/* coverage_badge.svg
git commit -m "Update code coverage reports and badge"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}