8000 [3.12] gh-115383: Use runner version to compute config.cache key (GH-… · python/cpython@9c73075 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9c73075

Browse files
[3.12] gh-115383: Use runner version to compute config.cache key (GH-115409) (#115427)
Co-authored-by: Sam Gross <colesbury@gmail.com>
1 parent 45e5599 commit 9c73075

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,13 @@ jobs:
158158
- uses: actions/setup-python@v4
159159
with:
160160
python-version: '3.x'
161+
- name: Runner image version
162+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
161163
- name: Restore config.cache
162164
uses: actions/cache@v3
163165
with:
164166
path: config.cache
165-
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
167+
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
166168
- name: Install Dependencies
167169
run: sudo ./.github/workflows/posix-deps-apt.sh
168170
- name: Add ccache to PATH
@@ -257,11 +259,13 @@ jobs:
257259
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
258260
steps:
259261
- uses: actions/checkout@v4
262+
- name: Runner image version
263+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
260264
- name: Restore config.cache
261265
uses: actions/cache@v3
262266
with:
263267
path: config.cache
264-
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
268+
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
265269
- name: Register gcc problem matcher
266270
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
267271
- name: Install Dependencies
@@ -340,11 +344,13 @@ jobs:
340344
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
341345
- name: Bind mount sources read-only
342346
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
347+
- name: Runner image version
348+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
343349
- name: Restore config.cache
344350
uses: actions/cache@v3
345351
with:
346352
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
347-
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
353+
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
348354
- name: Configure CPython out-of-tree
349355
working-directory: ${{ env.CPYTHON_BUILDDIR }}
350356
run: |
@@ -419,11 +425,13 @@ jobs:
419425
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
420426
steps:
421427
- uses: actions/checkout@v4
428+
- name: Runner image version
429+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
422430
- name: Restore config.cache
423431
uses: actions/cache@v3
424432
with:
425433
path: config.cache
426-
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
434+
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
427435
- name: Register gcc problem matcher
428436
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
429437
- name: Install Dependencies

.github/workflows/reusable-macos.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ jobs:
2828
runs-on: ${{ matrix.os }}
2929
steps:
3030
- uses: actions/checkout@v4
31+
- name: Runner image version
32+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
3133
- name: Restore config.cache
3234
uses: actions/cache@v3
3335
with:
3436
path: config.cache
35-
key: ${{ github.job }}-${{ matrix.os }}-${{ inputs.config_hash }}
37+
key: ${{ github.job }}-${{ matrix.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
3638
- name: Install Homebrew dependencies
3739
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
3840
- name: Configure CPython

.github/workflows/reusable-ubuntu.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ jobs:
5252
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
5353
- name: Bind mount sources read-only
5454
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
55+
- name: Runner image version
56+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
5557
- name: Restore config.cache
5658
uses: actions/cache@v3
5759
with:
5860
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
59-
key: ${{ github.job }}-${{ runner.os }}-${{ inputs.config_hash }}
61+
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
6062
- name: Configure CPython out-of-tree
6163
working-directory: ${{ env.CPYTHON_BUILDDIR }}
6264
run: ${{ inputs.options }}

0 commit comments

Comments
 (0)
0