-
Notifications
You must be signed in to change notification settings - Fork 9
38 lines (31 loc) · 1.14 KB
/
coverage-report.yml
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
name: Generate Test Coverage Report and Badge
on: pull_request
jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment.yml
- name: Generate Coverage Report and Badge
shell: bash -l {0}
run: |
python -m pip install --no-deps .
python -m pip install coverage-badge
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=hyp3_isce2 tests/ | tee pytest-coverage.txt
coverage-badge -fo images/coverage.svg
- name: Commit Coverage Badge
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
add: 'images/coverage.svg'
message: 'update coverage image'
- name: PR Coverage Comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml