Skip to content

add pytest install to workflow #3

add pytest install to workflow

add pytest install to workflow #3

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 coverage genbadge pytest
- name: "Run Coverage and Generate Badge"
run: |
coverage run -m pytest
coverage report
coverage xml
coverage html
genbadge coverage --input-file coverage.xml
- name: "Commit and Push Changes"
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add coverage.xml coverage.html coverage_badge.svg
git commit -m "Update code coverage reports and badge"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}