-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (51 loc) · 1.34 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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
black:
name: Lint with black
uses: ./.github/workflows/python-job.yml
with:
run: black --check .
secrets: inherit
isort:
name: Lint with isort
uses: ./.github/workflows/python-job.yml
with:
run: isort --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