2222 FORCE_COLOR : 1
2323
2424jobs :
25- check_source :
25+ build-context :
2626 name : Change detection
2727 # To use boolean outputs from this job, parse them as JSON.
2828 # Here's some examples:
2929 #
30- # if: fromJSON(needs.check_source .outputs.run-docs)
30+ # if: fromJSON(needs.build-context .outputs.run-docs)
3131 #
3232 # ${{
33- # fromJSON(needs.check_source .outputs.run_tests )
33+ # fromJSON(needs.build-context .outputs.run-tests )
3434 # && 'truthy-branch'
3535 # || 'falsy-branch'
3636 # }}
3737 #
38- uses : ./.github/workflows/reusable-change-detection .yml
38+ uses : ./.github/workflows/reusable-context .yml
3939
4040 check-docs :
4141 name : Docs
42- needs : check_source
43- if : fromJSON(needs.check_source .outputs.run-docs)
42+ needs : build-context
43+ if : fromJSON(needs.build-context .outputs.run-docs)
4444 uses : ./.github/workflows/reusable-docs.yml
4545
4646 check_autoconf_regen :
5151 container :
5252 image : ghcr.io/python/autoconf:2025.01.02.12581854023
5353 timeout-minutes : 60
54- needs : check_source
55- if : needs.check_source .outputs.run_tests == 'true'
54+ needs : build-context
55+ if : needs.build-context .outputs.run-tests == 'true'
5656 steps :
5757 - name : Install Git
5858 run : |
6262 with :
6363 fetch-depth : 1
6464 persist-credentials : false
65- - name : Runner image version
66- run : echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
6765 - name : Check Autoconf and aclocal versions
6866 run : |
6967 grep "Generated by GNU Autoconf 2.72" configure
9492 # reproducible: to get the same tools versions (autoconf, aclocal, ...)
9593 runs-on : ubuntu-24.04
9694 timeout-minutes : 60
97- needs : check_source
98- if : needs.check_source .outputs.run_tests == 'true'
95+ needs : build-context
96+ if : needs.build-context .outputs.run-tests == 'true'
9997 steps :
10098 - uses : actions/checkout@v4
10199 with :
@@ -104,14 +102,14 @@ jobs:
104102 with :
105103 python-version : ' 3.x'
106104 - name : Runner image version
107- run : echo "IMAGE_VERSION= ${ImageVersion}" >> "$GITHUB_ENV"
105+ run : echo "IMAGE_OS_VERSION=${ImageOS}- ${ImageVersion}" >> "$GITHUB_ENV"
108106 - name : Restore config.cache
109107 uses : actions/cache@v4
110108 with :
111109 path : config.cache
112110 # Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
113- key : ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source .outputs.config_hash }}-${{ env.pythonLocation }}
114- - name : Install Dependencies
111+ key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context .outputs.config-hash }}-${{ env.pythonLocation }}
112+ - name : Install dependencies
115113 run : sudo ./.github/workflows/posix-deps-apt.sh
116114 - name : Add ccache to PATH
117115 run : echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
@@ -153,8 +151,8 @@ jobs:
153151 name : >-
154152 Windows
155153 ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
156- needs : check_source
157- if : fromJSON(needs.check_source .outputs.run_tests )
154+ needs : build-context
155+ if : fromJSON(needs.build-context .outputs.run-windows-tests )
158156 strategy :
159157 fail-fast : false
160158 matrix :
@@ -184,8 +182,8 @@ jobs:
184182 build_windows_msi :
185183 name : >- # ${{ '' } is a hack to nest jobs under the same sidebar category
186184 Windows MSI${{ '' }}
187- needs : check_source
188- if : fromJSON(needs.check_source .outputs.run-win -msi)
185+ needs : build-context
186+ if : fromJSON(needs.build-context .outputs.run-windows -msi)
189187 strategy :
190188 matrix :
191189 arch :
@@ -200,8 +198,8 @@ jobs:
200198 name : >-
201199 macOS
202200 ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
203- needs : check_source
204- if : needs.check_source .outputs.run_tests == 'true'
201+ needs : build-context
202+ if : needs.build-context .outputs.run-tests == 'true'
205203 strategy :
206204 fail-fast : false
207205 matrix :
@@ -226,7 +224,7 @@ jobs:
226224 free-threading : true
227225 uses : ./.github/workflows/reusable-macos.yml
228226 with :
229- config_hash : ${{ needs.check_source .outputs.config_hash }}
227+ config_hash : ${{ needs.build-context .outputs.config-hash }}
230228 free-threading : ${{ matrix.free-threading }}
231229 os : ${{ matrix.os }}
232230
@@ -235,8 +233,8 @@ jobs:
235233 Ubuntu
236234 ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
237235 ${{ fromJSON(matrix.bolt) && '(bolt)' || '' }}
238- needs : check_source
239- if : needs.check_source .outputs.run_tests == 'true'
236+ needs : build-context
237+ if : needs.build-context .outputs.run-tests == 'true'
240238 strategy :
241239 matrix :
242240 bolt :
@@ -257,7 +255,7 @@ jobs:
257255 bolt : true
258256 uses : ./.github/workflows/reusable-ubuntu.yml
259257 with :
260- config_hash : ${{ needs.check_source .outputs.config_hash }}
258+ config_hash : ${{ needs.build-context .outputs.config-hash }}
261259 bolt-optimizations : ${{ matrix.bolt }}
262260 free-threading : ${{ matrix.free-threading }}
263261 os : ${{ matrix.os }}
@@ -266,8 +264,8 @@ jobs:
266264 name : ' Ubuntu SSL tests with OpenSSL'
267265 runs-on : ${{ matrix.os }}
268266 timeout-minutes : 60
269- needs : check_source
270- if : needs.check_source .outputs.run_tests == 'true'
267+ needs : build-context
268+ if : needs.build-context .outputs.run-tests == 'true'
271269 strategy :
272270 fail-fast : false
273271 matrix :
@@ -284,15 +282,15 @@ jobs:
284282 with :
285283 persist-credentials : false
286284 - name : Runner image version
287- run : echo "IMAGE_VERSION= ${ImageVersion}" >> "$GITHUB_ENV"
285+ run : echo "IMAGE_OS_VERSION=${ImageOS}- ${ImageVersion}" >> "$GITHUB_ENV"
288286 - name : Restore config.cache
289287 uses : actions/cache@v4
290288 with :
291289 path : config.cache
292- key : ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source .outputs.config_hash }}
290+ key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context .outputs.config-hash }}
293291 - name : Register gcc problem matcher
294292 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
295- - name : Install Dependencies
293+ - name : Install dependencies
296294 run : sudo ./.github/workflows/posix-deps-apt.sh
297295 - name : Configure OpenSSL env vars
298296 run : |
@@ -326,18 +324,18 @@ jobs:
326324
327325 build_wasi :
328326 name : ' WASI'
329- needs : check_source
330- if : needs.check_source .outputs.run_tests == 'true'
327+ needs : build-context
328+ if : needs.build-context .outputs.run-tests == 'true'
331329 uses : ./.github/workflows/reusable-wasi.yml
332330 with :
333- config_hash : ${{ needs.check_source .outputs.config_hash }}
331+ config_hash : ${{ needs.build-context .outputs.config-hash }}
334332
335333 test_hypothesis :
336334 name : " Hypothesis tests on Ubuntu"
337335 runs-on : ubuntu-24.04
338336 timeout-minutes : 60
339- needs : check_source
340- if : needs.check_source .outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
337+ needs : build-context
338+ if : needs.build-context .outputs.run-tests == 'true'
341339 env :
342340 OPENSSL_VER : 3.0.15
343341 PYTHONSTRICTEXTENSIONBUILD : 1
@@ -347,7 +345,7 @@ jobs:
347345 persist-credentials : false
348346 - name : Register gcc problem matcher
349347 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
350- - name : Install Dependencies
348+ - name : Install dependencies
351349 run : sudo ./.github/workflows/posix-deps-apt.sh
352350 - name : Configure OpenSSL env vars
353351 run : |
@@ -379,12 +377,12 @@ jobs:
379377 - name : Bind mount sources read-only
380378 run : sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
381379 - name : Runner image version
382- run : echo "IMAGE_VERSION= ${ImageVersion}" >> "$GITHUB_ENV"
380+ run : echo "IMAGE_OS_VERSION=${ImageOS}- ${ImageVersion}" >> "$GITHUB_ENV"
383381 - name : Restore config.cache
384382 uses : actions/cache@v4
385383 with :
386384 path : ${{ env.CPYTHON_BUILDDIR }}/config.cache
387- key : ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source .outputs.config_hash }}
385+ key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context .outputs.config-hash }}
388386 - name : Configure CPython out-of-tree
389387 working-directory : ${{ env.CPYTHON_BUILDDIR }}
390388 run : |
@@ -452,8 +450,8 @@ jobs:
452450 name : ' Address sanitizer'
453451 runs-on : ${{ matrix.os }}
454452 timeout-minutes : 60
455- needs : check_source
456- if : needs.check_source .outputs.run_tests == 'true'
453+ needs : build-context
454+ if : needs.build-context .outputs.run-tests == 'true'
457455 strategy :
458456 matrix :
459457 os : [ubuntu-24.04]
@@ -466,15 +464,15 @@ jobs:
466464 with :
467465 persist-credentials : false
468466 - name : Runner image version
469- run : echo "IMAGE_VERSION= ${ImageVersion}" >> "$GITHUB_ENV"
467+ run : echo "IMAGE_OS_VERSION=${ImageOS}- ${ImageVersion}" >> "$GITHUB_ENV"
470468 - name : Restore config.cache
471469 uses : actions/cache@v4
472470 with :
473471 path : config.cache
474- key : ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source .outputs.config_hash }}
472+ key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context .outputs.config-hash }}
475473 - name : Register gcc problem matcher
476474 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
477- - name : Install Dependencies
475+ - name : Install dependencies
478476 run : sudo ./.github/workflows/posix-deps-apt.sh
479477 - name : Set up GCC-10 for ASAN
480478 uses : egor-tensin/setup-gcc@v1
@@ -515,41 +513,41 @@ jobs:
515513 name : >-
516514 Thread sanitizer
517515 ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
518- needs : check_source
519- if : needs.check_source .outputs.run_tests == 'true'
516+ needs : build-context
517+ if : needs.build-context .outputs.run-tests == 'true'
520518 strategy :
521519 matrix :
522520 free-threading :
523521 - false
524522 - true
525523 uses : ./.github/workflows/reusable-tsan.yml
526524 with :
527- config_hash : ${{ needs.check_source .outputs.config_hash }}
525+ config_hash : ${{ needs.build-context .outputs.config-hash }}
528526 free-threading : ${{ matrix.free-threading }}
529527
530528 cross-build-linux :
531529 name : Cross build Linux
532530 runs-on : ubuntu-latest
533- needs : check_source
534- if : needs.check_source .outputs.run_tests == 'true'
531+ needs : build-context
532+ if : needs.build-context .outputs.run-tests == 'true'
535533 steps :
536534 - uses : actions/checkout@v4
537535 with :
538536 persist-credentials : false
539537 - name : Runner image version
540- run : echo "IMAGE_VERSION= ${ImageVersion}" >> "$GITHUB_ENV"
538+ run : echo "IMAGE_OS_VERSION=${ImageOS}- ${ImageVersion}" >> "$GITHUB_ENV"
541539 - name : Restore config.cache
542540 uses : actions/cache@v4
543541 with :
544542 path : config.cache
545- key : ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source .outputs.config_hash }}
543+ key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context .outputs.config-hash }}
546544 - name : Register gcc problem matcher
547545 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
548546 - name : Set build dir
549547 run :
550548 # an absolute path outside of the working directoy
551549 echo "BUILD_DIR=$(realpath ${{ github.workspace }}/../build)" >> "$GITHUB_ENV"
552- - name : Install Dependencies
550+ - name : Install dependencies
553551 run : sudo ./.github/workflows/posix-deps-apt.sh
554552 - name : Configure host build
555553 run : ./configure --prefix="$BUILD_DIR/host-python"
@@ -571,8 +569,8 @@ jobs:
571569 name : CIFuzz
572570 runs-on : ubuntu-latest
573571 timeout-minutes : 60
574- needs : check_source
575- if : needs.check_source .outputs.run_cifuzz == 'true'
572+ needs : build-context
573+ if : needs.build-context .outputs.run-ci-fuzz == 'true'
576574 permissions :
577575 security-events : write
578576 strategy :
@@ -611,7 +609,7 @@ jobs:
611609 if : always()
612610
613611 needs :
614- - check_source # Transitive dependency, needed to access `run_tests ` value
612+ - build-context # Transitive dependency, needed to access `run-tests ` value
615613 - check-docs
616614 - check_autoconf_regen
617615 - check_generated_files
@@ -621,6 +619,7 @@ jobs:
621619 - build_wasi
622620 - build_windows
623621 - build_windows_msi
622+ - cross-build-linux
624623 - test_hypothesis
625624 - build_asan
626625 - build_tsan
@@ -639,38 +638,39 @@ jobs:
639638 test_hypothesis,
640639 allowed-skips : >-
641640 ${{
642- !fromJSON(needs.check_source .outputs.run-docs)
641+ !fromJSON(needs.build-context .outputs.run-docs)
643642 && '
644643 check-docs,
645644 '
646645 || ''
647646 }}
648647 ${{
649- needs.check_source .outputs.run_tests != 'true'
648+ needs.build-context .outputs.run-tests != 'true'
650649 && '
651650 check_autoconf_regen,
652651 check_generated_files,
653652 build_macos,
654653 build_ubuntu,
655654 build_ubuntu_ssltests,
656655 build_wasi,
657- build_windows,
658656 build_asan,
659657 build_tsan,
658+ test_hypothesis,
659+ cross-build-linux,
660660 '
661661 || ''
662662 }}
663663 ${{
664- !fromJSON(needs.check_source .outputs.run_cifuzz )
664+ !fromJSON(needs.build-context .outputs.run-windows-tests )
665665 && '
666- cifuzz ,
666+ build_windows ,
667667 '
668668 || ''
669669 }}
670670 ${{
671- !fromJSON(needs.check_source .outputs.run_hypothesis )
671+ !fromJSON(needs.build-context .outputs.run-ci-fuzz )
672672 && '
673- test_hypothesis ,
673+ cifuzz ,
674674 '
675675 || ''
676676 }}
0 commit comments