-
Notifications
You must be signed in to change notification settings - Fork 44
56 lines (47 loc) · 1.51 KB
/
coverage-badge.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# This workflow will generate and push an updated coverage badge
name: Coverage Badge
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
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"