-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (39 loc) · 1.07 KB
/
pull_request.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
39
40
41
42
43
44
45
name: Pull Request Checks
on:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
ruff:
name: Lint with ruff
uses: ./.github/workflows/python-job.yml
with:
run: ruff check .
secrets: inherit
test:
name: Run tests
uses: ./.github/workflows/python-job.yml
with:
run: |
mkdir reports
pytest --junit-xml=reports/pytest.xml --cov --cov-report=term-missing:skip-covered | tee reports/coverage.txt
artifact: pytest-results
artifact_path: reports/
secrets: inherit
report-coverage:
name: Report tests coverage
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
needs: [test]
steps:
- name: Download Pytest results
uses: actions/download-artifact@v4
with:
name: pytest-results
path: reports
- name: Add PR comment
uses: MishaKav/pytest-coverage-comment@main
with:
junitxml-path: reports/pytest.xml
pytest-coverage-path: reports/coverage.txt
report-only-changed-files: true