-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (85 loc) · 2.61 KB
/
ci.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI
on: pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
matrix:
name: Build test matrix
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- name: Run tox
id: matrix
run: |
pip install $(grep -E "^(tox|tox-uv)==" requirements/local.txt)
echo "tox_matrix=$(tox -l | fgrep -v coverage | python .github/matrix.py)" >> $GITHUB_OUTPUT
outputs:
tox_matrix: ${{ steps.matrix.outputs.tox_matrix }}
test:
name: Test -- ${{ matrix.tox_env }}
runs-on: ubuntu-24.04
needs: matrix
strategy:
matrix:
include: ${{ fromJson(needs.matrix.outputs.tox_matrix) }}
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- name: Run tests
run: |
pip install $(grep -E "^(tox|tox-uv)==" requirements/local.txt)
tox -e ${{ matrix.tox_env }}
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.tox_env }}
include-hidden-files: true
path: .coverage.*
if-no-files-found: ignore
coverage:
name: Coverage
runs-on: ubuntu-24.04
needs: test
if: always()
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true
- name: Run coverage
run: |
pip install $(grep -E "^(tox|tox-uv)==" requirements/local.txt)
tox -e coverage
tox -qq exec -e coverage -- coverage report --format=markdown >> $GITHUB_STEP_SUMMARY