Skip to content

Commit

Permalink
Add coverage badge workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
haeussma committed Sep 20, 2024
1 parent 862a5a2 commit 1b4008d
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Coverage Badge

on:
push:
branches:
- main
- dev
pull_request:

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install genbadge[coverage]
- name: Run tests and generate coverage report
run: |
coverage run -m pytest
coverage xml -o reports/coverage/coverage.xml
- name: Generate coverage badge
run: genbadge coverage -i reports/coverage/coverage.xml -o coverage-badge.svg

- name: Upload coverage badge to repo
uses: actions/upload-artifact@v3
with:
name: coverage-badge
path: coverage-badge.svg

0 comments on commit 1b4008d

Please sign in to comment.