@@ -38,12 +38,12 @@ jobs:
38
38
timeout-minutes : 45
39
39
strategy :
40
40
matrix :
41
- python-version : ["3.9", "3.12 "]
41
+ python-version : ["3.9", "3.13 "]
42
42
batches : [4]
43
43
batchIdx : [0, 1, 2, 3]
44
44
steps :
45
45
- name : Check out code from GitHub
46
- uses : actions/checkout@v4.1.7
46
+ uses : actions/checkout@v4.2.1
47
47
with :
48
48
fetch-depth : 0
49
49
- name : Set up Python ${{ matrix.python-version }}
56
56
# Restore cached Python environment
57
57
- name : Restore Python virtual environment
58
58
id : cache-venv
59
- uses : actions/cache@v4.0.2
59
+ uses : actions/cache/restore @v4.1.1
60
60
with :
61
61
path : venv
62
62
key :
72
72
. venv/bin/activate
73
73
python -m pip install -U pip setuptools wheel
74
74
pip install -U -r requirements_test.txt
75
+ # Save cached Python environment (explicit because cancel-in-progress: true)
76
+ - name : Save Python virtual environment
77
+ if : steps.cache-venv.outputs.cache-hit != 'true'
78
+ uses :
actions/cache/[email protected]
79
+ with :
80
+ path : venv
81
+ key :
82
+ ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
83
+ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml',
84
+ ' requirements_test.txt' , 'requirements_test_min.txt',
85
+ ' requirements_test_pre_commit.txt' ) }}
75
86
76
87
# Cache primer packages
77
88
- name : Download last 'main' run info
@@ -140,7 +151,7 @@ jobs:
140
151
echo "commitstring=$output" >> $GITHUB_OUTPUT
141
152
- name : Restore projects cache
142
153
id : cache-projects
143
- uses : actions/cache@v4.0.2
154
+ uses : actions/cache/restore @v4.1.1
144
155
with :
145
156
path : tests/.pylint_primer_tests/
146
157
key : >-
@@ -151,6 +162,14 @@ jobs:
151
162
run : |
152
163
. venv/bin/activate
153
164
python tests/primer/__main__.py prepare --clone
165
+ - name : Save projects cache
166
+ if : steps.cache-projects.outputs.cache-hit != 'true'
167
+ uses :
actions/cache/[email protected]
168
+ with :
169
+ path : tests/.pylint_primer_tests/
170
+ key : >-
171
+ ${{ runner.os }}-${{ matrix.python-version }}-${{
172
+ steps.commitstring.outputs.commitstring }}-primer
154
173
- name : Check cache
155
174
run : |
156
175
. venv/bin/activate
@@ -178,15 +197,15 @@ jobs:
178
197
then echo "::warning ::$WARNINGS"
179
198
fi
180
199
- name : Upload output of PR
181
-
200
+
182
201
with :
183
202
name :
184
203
primer_output_pr_${{ matrix.python-version }}_batch${{ matrix.batchIdx }}
185
204
path :
186
205
tests/.pylint_primer_tests/output_${{ matrix.python-version }}_pr_batch${{
187
206
matrix.batchIdx }}.txt
188
207
- name : Upload output of 'main'
189
-
208
+
190
209
with :
191
210
name :
192
211
primer_output_main_${{ matrix.python-version }}_batch${{ matrix.batchIdx }}
@@ -199,7 +218,7 @@ jobs:
199
218
- name : Upload PR number
200
219
if :
201
220
startsWith(steps.python.outputs.python-version, '3.9') && matrix.batchIdx == 0
202
-
221
+
203
222
with :
204
223
name : pr_number
205
224
path : pr_number.txt
0 commit comments