@@ -38,12 +38,12 @@ jobs:
3838 timeout-minutes : 45
3939 strategy :
4040 matrix :
41- python-version : ["3.9", "3.12 "]
41+ python-version : ["3.9", "3.13 "]
4242 batches : [4]
4343 batchIdx : [0, 1, 2, 3]
4444 steps :
4545 - name : Check out code from GitHub
46- uses : actions/checkout@v4.1.7
46+ uses : actions/checkout@v4.2.1
4747 with :
4848 fetch-depth : 0
4949 - name : Set up Python ${{ matrix.python-version }}
5656 # Restore cached Python environment
5757 - name : Restore Python virtual environment
5858 id : cache-venv
59- uses : actions/cache@v4.0.2
59+ uses : actions/cache/restore @v4.1.1
6060 with :
6161 path : venv
6262 key :
7272 . venv/bin/activate
7373 python -m pip install -U pip setuptools wheel
7474 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' ) }}
7586
7687 # Cache primer packages
7788 - name : Download last 'main' run info
@@ -140,7 +151,7 @@ jobs:
140151 echo "commitstring=$output" >> $GITHUB_OUTPUT
141152 - name : Restore projects cache
142153 id : cache-projects
143- uses : actions/cache@v4.0.2
154+ uses : actions/cache/restore @v4.1.1
144155 with :
145156 path : tests/.pylint_primer_tests/
146157 key : >-
@@ -151,6 +162,14 @@ jobs:
151162 run : |
152163 . venv/bin/activate
153164 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
154173 - name : Check cache
155174 run : |
156175 . venv/bin/activate
@@ -178,15 +197,15 @@ jobs:
178197 then echo "::warning ::$WARNINGS"
179198 fi
180199 - name : Upload output of PR
181- 200+ 182201 with :
183202 name :
184203 primer_output_pr_${{ matrix.python-version }}_batch${{ matrix.batchIdx }}
185204 path :
186205 tests/.pylint_primer_tests/output_${{ matrix.python-version }}_pr_batch${{
187206 matrix.batchIdx }}.txt
188207 - name : Upload output of 'main'
189- 208+ 190209 with :
191210 name :
192211 primer_output_main_${{ matrix.python-version }}_batch${{ matrix.batchIdx }}
@@ -199,7 +218,7 @@ jobs:
199218 - name : Upload PR number
200219 if :
201220 startsWith(steps.python.outputs.python-version, '3.9') && matrix.batchIdx == 0
202- 221+ 203222 with :
204223 name : pr_number
205224 path : pr_number.txt
0 commit comments