-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.12 KB
/
pytest.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
name: Pytest
on:
push:
branches:
- main
pull_request:
jobs:
run_pytest:
name: pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: '3.12.7'
cache: 'poetry'
- run: poetry install --no-interaction --no-ansi
- name: Run Tests
run: |
poetry run pytest \
--cov \
--cov-report=xml \
--cov-report=term-missing \
${{ inputs.pytest_arguments }}
- name: Compare coverage (optional)
if: ${{ github.event_name == 'pull_request' }}
run: |
poetry run diff-cover coverage.xml \
--compare-branch=origin/main \
--json-report=diff_coverage.json \
--fail-under=80
- name: Annotate uncovered lines
if: ${{ always() && github.event_name == 'pull_request' }}
uses: drew2a/annotate-coverage-action@v1
with:
json_path: "diff_coverage.json"