8000 [3.11] CI: Precompute hash for config cache key in check_source job (… · python/cpython@d1a7d66 · GitHub
[go: up one dir, main page]

Skip to content

Commit d1a7d66

Browse files
authored
[3.11] CI: Precompute hash for config cache key in check_source job (GH-105008) (#105024)
1 parent b9e2d80 commit d1a7d66

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
outputs:
3838
run_tests: ${{ steps.check.outputs.run_tests }}
3939
run_ssl_tests: ${{ steps.check.outputs.run_ssl_tests }}
40+
config_hash: ${{ steps.config_hash.outputs.hash }}
4041
steps:
4142
- uses: actions/checkout@v3
4243
- name: Check for source changes
@@ -63,6 +64,10 @@ jobs:
6364
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> $GITHUB_OUTPUT || true
6465
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qE '(ssl|hashlib|hmac|^.github)' && echo "run_ssl_tests=true" >> $GITHUB_OUTPUT || true
6566
fi
67+
- name: Compute hash for config cache key
68+
id: config_hash
69+
run: |
70+
echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> $GITHUB_OUTPUT
6671
6772
check_abi:
6873
name: 'Check if the ABI has changed'
@@ -106,7 +111,7 @@ jobs:
106111
uses: actions/cache@v3
107112
with:
108113
path: config.cache
109-
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
114+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
110115
- uses: actions/setup-python@v3
111116
- name: Install Dependencies
112117
run: sudo ./.github/workflows/posix-deps-apt.sh
@@ -205,7 +210,7 @@ jobs:
205210
uses: actions/cache@v3
206211
with:
207212
path: config.cache
208-
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
213+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
209214
- name: Install Homebrew dependencies
210215
run: brew install pkg-config openssl@1.1 xz gdbm tcl-tk
211216
- name: Configure CPython
@@ -271,7 +276,7 @@ jobs:
271276
uses: actions/cache@v3
272277
with:
273278
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
274-
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
279+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
275280
- name: Configure CPython out-of-tree
276281
working-directory: ${{ env.CPYTHON_BUILDDIR }}
277282
run: |
@@ -313,7 +318,7 @@ jobs:
313318
uses: actions/cache@v3
314319
with:
315320
path: config.cache
316-
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
321+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
317322
- name: Register gcc problem matcher
318323
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
319324
- name: Install Dependencies
@@ -362,7 +367,7 @@ jobs:
362367
uses: actions/cache@v3
363368
with:
364369
path: config.cache
365-
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
370+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
366371
- name: Register gcc problem matcher
367372
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
368373
- name: Install Dependencies

0 commit comments

Comments
 (0)
0