1010 workflow_dispatch :
1111
1212env :
13- DEFAULT_PYTHON : " 3.12 "
13+ DEFAULT_PYTHON : " 3.13 "
1414 PRE_COMMIT_CACHE : ~/.cache/pre-commit
1515
1616concurrency :
@@ -22,25 +22,28 @@ jobs:
2222 # This prevent upcoming jobs to do the same individually
2323 prepare :
2424 runs-on : ubuntu-latest
25+ strategy :
26+ matrix :
27+ python-version : ["3.12", "3.13"]
2528 outputs :
26- python-version : ${{ steps.python.outputs .python-version }}
27- name : Prepare Python dependencies
29+ python-version : ${{ matrix .python-version }}
30+ name : Prepare Python ${{ matrix.python-version }} dependencies
2831 steps :
2932 - name : Check out code from GitHub
30333134 - name : Set up Python
3235 id : python
33363437 with :
35- python-version : ${{ env.DEFAULT_PYTHON }}
38+ python-version : ${{ matrix.python-version }}
3639 - name : Restore Python virtual environment
3740 id : cache-venv
38413942 with :
4043 path : venv
41- key : |
42- ${{ runner.os }}-venv-${{ steps .python.outputs.python -version }}-${{
43- hashFiles('pyproject.toml') }}
44+ key : >
45+ ${{ runner.os }}-venv-${{ matrix .python-version }}-
46+ ${{ hashFiles('pyproject.toml') }}
4447 - name : Create Python virtual environment
4548 if : steps.cache-venv.outputs.cache-hit != 'true'
4649 run : |
5457 with :
5558 path : ${{ env.PRE_COMMIT_CACHE }}
5659 lookup-only : true
57- key : |
58- ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml')
59- }}
60+ key : >
61+ ${{ runner.os }}-pre-commit-${{ matrix.python-version }}-
62+ ${{ hashFiles('.pre-commit-config.yaml') }}
6063 restore-keys : |
6164 ${{ runner.os }}-pre-commit-
6265 - name : Install pre-commit dependencies
@@ -66,25 +69,28 @@ jobs:
6669 pre-commit install-hooks
6770
6871 lint-ruff-format :
69- name : Check ruff-format
72+ name : Check ruff-format Python ${{ matrix.python-version }}
7073 runs-on : ubuntu-latest
7174 needs : prepare
75+ strategy :
76+ matrix :
77+ python-version : ["3.12", "3.13"]
7278 steps :
7379 - name : Check out code from GitHub
748075- - name : Set up Python ${{ needs.prepare.outputs .python-version }}
81+ - name : Set up Python ${{ matrix .python-version }}
76827783 id : python
7884 with :
79- python-version : ${{ needs.prepare.outputs .python-version }}
85+ python-version : ${{ matrix .python-version }}
8086 - name : Restore Python virtual environment
8187 id : cache-venv
82888389 with :
8490 path : venv
85- key : |
86- ${{ runner.os }}-venv-${{ needs.prepare.outputs. python-version
87- }}- ${{ hashFiles('pyproject.toml') }}
91+ key : >
92+ ${{ runner.os }}-venv-${{ matrix. python-version }}-
93+ ${{ hashFiles('pyproject.toml') }}
8894 - name : Fail job if Python cache restore failed
8995 if : steps.cache-venv.outputs.cache-hit != 'true'
9096 run : |
9510196102 with :
97103 path : ${{ env.PRE_COMMIT_CACHE }}
98- key : |
99- ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml')
100- }}
104+ key : >
105+ ${{ runner.os }}-pre-commit-${{ matrix.python-version }}-
106+ ${{ hashFiles('.pre-commit-config.yaml') }}
101107 - name : Fail job if cache restore failed
102108 if : steps.cache-venv.outputs.cache-hit != 'true'
103109 run : |
@@ -112,25 +118,28 @@ jobs:
112118 RUFF_OUTPUT_FORMAT : github
113119
114120 lint-ruff :
115- name : Check ruff
121+ name : Check ruff Python ${{ matrix.python-version }}
116122 runs-on : ubuntu-latest
117123 needs : prepare
124+ strategy :
125+ matrix :
126+ python-version : ["3.12", "3.13"]
118127 steps :
119128 - name : Check out code from GitHub
120129121- - name : Set up Python ${{ needs.prepare.outputs .python-version }}
130+ - name : Set up Python ${{ matrix .python-version }}
122131123132 id : python
124133 with :
125- python-version : ${{ needs.prepare.outputs .python-version }}
134+ python-version : ${{ matrix .python-version }}
126135 - name : Restore Python virtual environment
127136 id : cache-venv
128137129138 with :
130139 path : venv
131- key : |
132- ${{ runner.os }}-venv-${{ needs.prepare.outputs. python-version
133- }}- ${{ hashFiles('pyproject.toml') }}
140+ key : >
141+ ${{ runner.os }}-venv-${{ matrix. python-version }}-
142+ ${{ hashFiles('pyproject.toml') }}
134143 - name : Fail job if Python cache restore failed
135144 if : steps.cache-venv.outputs.cache-hit != 'true'
136145 run : |
@@ -141,9 +150,9 @@ jobs:
141150142151 with :
143152 path : ${{ env.PRE_COMMIT_CACHE }}
144- key : |
145- ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml')
146- }}
153+ key : >
154+ ${{ runner.os }}-pre-commit-${{ matrix.python-version }}-
155+ ${{ hashFiles('.pre-commit-config.yaml') }}
147156 - name : Fail job if cache restore failed
148157 if : steps.cache-venv.outputs.cache-hit != 'true'
149158 run : |
@@ -158,25 +167,28 @@ jobs:
158167 RUFF_OUTPUT_FORMAT : github
159168
160169 lint-other :
161- name : Check other linters
170+ name : Check other linters Python ${{ matrix.python-version }}
162171 runs-on : ubuntu-24.04
163172 needs : prepare
173+ strategy :
174+ matrix :
175+ python-version : ["3.12", "3.13"]
164176 steps :
165177 - name : Check out code from GitHub
166178167- - name : Set up Python ${{ needs.prepare.outputs .python-version }}
179+ - name : Set up Python ${{ matrix .python-version }}
168180169181 id : python
170182 with :
171- python-version : ${{ needs.prepare.outputs .python-version }}
183+ python-version : ${{ matrix .python-version }}
172184 - name : Restore Python virtual environment
173185 id : cache-venv
174186175187 with :
176188 path : venv
177- key : |
178- ${{ runner.os }}-venv-${{ needs.prepare.outputs. python-version
179- }}- ${{ hashFiles('pyproject.toml') }}
189+ key : >
190+ ${{ runner.os }}-venv-${{ matrix. python-version }}-
191+ ${{ hashFiles('pyproject.toml') }}
180192 - name : Fail job if Python cache restore failed
181193 if : steps.cache-venv.outputs.cache-hit != 'true'
182194 run : |
@@ -187,9 +199,9 @@ jobs:
187199188200 with :
189201 path : ${{ env.PRE_COMMIT_CACHE }}
190- key : |
191- ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml')
192- }}
202+ key : >
203+ ${{ runner.os }}-pre-commit-${{ matrix.python-version }}-
204+ ${{ hashFiles('.pre-commit-config.yaml') }}
193205 - name : Fail job if cache restore failed
194206 if : steps.cache-venv.outputs.cache-hit != 'true'
195207 run : |
@@ -249,23 +261,26 @@ jobs:
249261 pytest :
250262 runs-on : ubuntu-latest
251263 needs : prepare
252- name : Run tests Python ${{ needs.prepare.outputs.python-version }}
264+ strategy :
265+ matrix :
266+ python-version : ["3.12", "3.13"]
267+ name : Run tests Python ${{ matrix.python-version }}
253268 steps :
254269 - name : Check out code from GitHub
255270256- - name : Set up Python ${{ needs.prepare.outputs .python-version }}
271+ - name : Set up Python ${{ matrix .python-version }}
257272258273 id : python
259274 with :
260- python-version : ${{ needs.prepare.outputs .python-version }}
275+ python-version : ${{ matrix .python-version }}
261276 - name : Restore Python virtual environment
262277 id : cache-venv
263278264279 with :
265280 path : venv
266- key : |
267- ${{ runner.os }}-venv-${{ needs.prepare.outputs. python-version
268- }}- ${{ hashFiles('pyproject.toml') }}
281+ key : >
282+ ${{ runner.os }}-venv-${{ matrix. python-version }}-
283+ ${{ hashFiles('pyproject.toml') }}
269284 - name : Fail job if Python cache restore failed
270285 if : steps.cache-venv.outputs.cache-hit != 'true'
271286 run : |
@@ -304,26 +319,26 @@ jobs:
304319 steps :
305320 - name : Check out code from GitHub
306321307- - name : Set up Python ${{ needs.prepare.outputs.python-version }}
322+ - name : Set up Python ${{ env.DEFAULT_PYTHON }}
308323309324 id : python
310325 with :
311- python-version : ${{ needs.prepare.outputs.python-version }}
326+ python-version : ${{ env.DEFAULT_PYTHON }}
312327 - name : Restore Python virtual environment
313328 id : cache-venv
314329315330 with :
316331 path : venv
317- key : |
318- ${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version
319- }}- ${{ hashFiles('pyproject.toml') }}
332+ key : >
333+ ${{ runner.os }}-venv-${{ env.DEFAULT_PYTHON }}-
334+ ${{ hashFiles('pyproject.toml') }}
320335 - name : Fail job if Python cache restore failed
321336 if : steps.cache-venv.outputs.cache-hit != 'true'
322337 run : |
323338 echo "Failed to restore Python virtual environment from cache"
324339 exit 1
325340 - name : Download all coverage artifacts
326- uses : actions/download-artifact@v4.1.8
341+ uses : actions/download-artifact@v5.0.0
327342 - name : Combine coverage results
328343 run : |
329344 . venv/bin/activate
0 commit comments