@@ -205,56 +205,20 @@ jobs:
205
205
with :
206
206
fetch-depth : 0
207
207
ref : ${{ github.event.inputs.release-committish }}
208
- - name : >-
209
- Calculate Python interpreter version hash value
210
- for use in the cache key
211
- if: >-
212
- steps.request-check.outputs.release-requested != 'true'
213
- id: calc-cache-key-py
214
- run: |
215
- from hashlib import sha512
216
- from os import environ
217
- from pathlib import Path
218
- from sys import version
219
-
220
- FILE_APPEND_MODE = 'a'
221
-
222
- hash = sha512(version.encode()).hexdigest()
223
-
224
- with Path(environ['GITHUB_OUTPUT']).open(
225
- mode=FILE_APPEND_MODE,
226
- ) as outputs_file:
227
- print(f'py-hash-key={hash}', file=outputs_file)
228
208
- name : >-
229
209
Calculate dependency files' combined hash value
230
210
for use in the cache key
231
211
if: >-
232
212
steps.request-check.outputs.release-requested != 'true'
233
213
id: calc-cache-key-files
234
214
uses: ./.github/actions/cache-keys
235
- - name : Get pip cache dir
236
- id : pip-cache-dir
237
- if : >-
238
- steps.request-check.outputs.release-requested != 'true'
239
- run : >-
240
- echo "dir=$(python -m pip cache dir)" >> "${GITHUB_OUTPUT}"
241
- shell : bash
242
215
- name : Set up pip cache
243
216
if : >-
244
217
steps.request-check.outputs.release-requested != 'true'
245
- uses : actions /cache@v4
218
+ uses : re-actors /cache-python-deps@release/v1
246
219
with :
247
- path : ${{ steps.pip-cache-dir.outputs.dir }}
248
- key : >-
249
- ${{ runner.os }}-pip-${{
250
- steps.calc-cache-key-py.outputs.py-hash-key }}-${{
251
- steps.calc-cache-key-files.outputs.cache-key-for-dep-files }}
252
- restore-keys : |
253
- ${{ runner.os }}-pip-${{
254
- steps.calc-cache-key-py.outputs.py-hash-key
255
- }}-
256
- ${{ runner.os }}-pip-
257
- ${{ runner.os }}-
220
+ cache-key-for-dependency-files : >-
221
+ ${{ steps.calc-cache-key-files.outputs.cache-key-for-dep-files }}
258
222
- name : Drop Git tags from HEAD for non-release requests
259
223
if : >-
260
224
steps.request-check.outputs.release-requested != 'true'
@@ -391,43 +355,11 @@ jobs:
391
355
}}
392
356
ref : ${{ github.event.inputs.release-committish }}
393
357
394
- - name : >-
395
- Calculate Python interpreter version hash value
396
- for use in the cache key
397
- id: calc-cache-key-py
398
- run: |
399
- from hashlib import sha512
400
- from os import environ
401
- from pathlib import Path
402
- from sys import version
403
-
404
- FILE_APPEND_MODE = 'a'
405
-
406
- hash = sha512(version.encode()).hexdigest()
407
-
408
- with Path(environ['GITHUB_OUTPUT']).open(
409
- mode=FILE_APPEND_MODE,
410
- ) as outputs_file:
411
- print(f'py-hash-key={hash}', file=outputs_file)
412
- shell: python
413
- - name : Get pip cache dir
414
- id : pip-cache-dir
415
- run : >-
416
- echo "dir=$(python -m pip cache dir)" >> "${GITHUB_OUTPUT}"
417
358
- name : Set up pip cache
418
- uses : actions /cache@v4
359
+ uses : re-actors /cache-python-deps@release/v1
419
360
with :
420
- path : ${{ steps.pip-cache-dir.outputs.dir }}
421
- key : >-
422
- ${{ runner.os }}-pip-${{
423
- steps.calc-cache-key-py.outputs.py-hash-key }}-${{
424
- needs.pre-setup.outputs.cache-key-for-dep-files }}
425
- restore-keys : |
426
- ${{ runner.os }}-pip-${{
427
- steps.calc-cache-key-py.outputs.py-hash-key
428
- }}-
429
- ${{ runner.os }}-pip-
430
-
361
+ cache-key-for-dependency-files : >-
362
+ ${{ needs.pre-setup.outputs.cache-key-for-dep-files }}
431
363
- name : Install tox
432
364
run : >-
433
365
python -Im pip install tox
0 commit comments