22
22
FORCE_COLOR : 1
23
23
24
24
jobs :
25
- check_source :
25
+ build-context :
26
26
name : Change detection
27
27
# To use boolean outputs from this job, parse them as JSON.
28
28
# Here's some examples:
29
29
#
30
- # if: fromJSON(needs.check_source .outputs.run-docs)
30
+ # if: fromJSON(needs.build-context .outputs.run-docs)
31
31
#
32
32
# ${{
33
- # fromJSON(needs.check_source .outputs.run_tests )
33
+ # fromJSON(needs.build-context .outputs.run-tests )
34
34
# && 'truthy-branch'
35
35
# || 'falsy-branch'
36
36
# }}
37
37
#
38
- uses : ./.github/workflows/reusable-change-detection .yml
38
+ uses : ./.github/workflows/reusable-context .yml
39
39
40
40
check-docs :
41
41
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)
44
44
uses : ./.github/workflows/reusable-docs.yml
45
45
46
46
check_autoconf_regen :
51
51
container :
52
52
image : ghcr.io/python/autoconf:2025.01.02.12581854023
53
53
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'
56
56
steps :
57
57
- name : Install Git
58
58
run : |
62
62
with :
63
63
fetch-depth : 1
64
64
persist-credentials : false
65
- - name : Runner image version
66
- run : echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
67
65
- name : Check Autoconf and aclocal versions
68
66
run : |
69
67
grep "Generated by GNU Autoconf 2.72" configure
94
92
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
95
93
runs-on : ubuntu-24.04
96
94
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'
99
97
steps :
100
98
- uses : actions/checkout@v4
101
99
with :
@@ -104,14 +102,14 @@ jobs:
104
102
with :
105
103
python-version : ' 3.x'
106
104
- name : Runner image version
107
- run : echo "IMAGE_VERSION= ${ImageVersion}" >> "$GITHUB_ENV"
105
+ run : echo "IMAGE_OS_VERSION=${ImageOS}- ${ImageVersion}" >> "$GITHUB_ENV"
108
106
- name : Restore config.cache
109
107
uses : actions/cache@v4
110
108
with :
111
109
path : config.cache
112
110
# 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
115
113
run : sudo ./.github/workflows/posix-deps-apt.sh
116
114
- name : Add ccache to PATH
117
115
run : echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
@@ -153,8 +151,8 @@ jobs:
153
151
name : >-
154
152
Windows
155
153
${{ 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 )
158
156
strategy :
159
157
fail-fast : false
160
158
matrix :
@@ -184,8 +182,8 @@ jobs:
184
182
build_windows_msi :
185
183
name : >- # ${{ '' } is a hack to nest jobs under the same sidebar category
186
184
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)
189
187
strategy :
190
188
matrix :
191
189
arch :
@@ -200,8 +198,8 @@ jobs:
200
198
name : >-
201
199
macOS
202
200
${{ 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'
205
203
strategy :
206
204
fail-fast : false
207
205
matrix :
@@ -226,7 +224,7 @@ jobs:
226
224
free-threading : true
227
225
uses : ./.github/workflows/reusable-macos.yml
228
226
with :
229
- config_hash : ${{ needs.check_source .outputs.config_hash }}
227
+ config_hash : ${{ needs.build-context .outputs.config-hash }}
230
228
free-threading : ${{ matrix.free-threading }}
231
229
os : ${{ matrix.os }}
232
230
@@ -235,8 +233,8 @@ jobs:
235
233
Ubuntu
236
234
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
237
235
${{ 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'
240
238
strategy :
241
239
matrix :
242
240
bolt :
@@ -257,7 +255,7 @@ jobs:
257
255
bolt : true
258
256
uses : ./.github/workflows/reusable-ubuntu.yml
259
257
with :
260
- config_hash : ${{ needs.check_source .outputs.config_hash }}
258
+ config_hash : ${{ needs.build-context .outputs.config-hash }}
261
259
bolt-optimizations : ${{ matrix.bolt }}
262
260
free-threading : ${{ matrix.free-threading }}
263
261
os : ${{ matrix.os }}
@@ -266,8 +264,8 @@ jobs:
266
264
name : ' Ubuntu SSL tests with OpenSSL'
267
265
runs-on : ${{ matrix.os }}
268
266
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'
271
269
strategy :
272
270
fail-fast : false
273
271
matrix :
@@ -284,15 +282,15 @@ jobs:
284
282
with :
285
283
persist-credentials : false
286
284
- name : Runner image version
287
- run : echo "IMAGE_VERSION= ${ImageVersion}" >> "$GITHUB_ENV"
285
+ run : echo "IMAGE_OS_VERSION=${ImageOS}- ${ImageVersion}" >> "$GITHUB_ENV"
288
286
- name : Restore config.cache
289
287
uses : actions/cache@v4
290
288
with :
291
289
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 }}
293
291
- name : Register gcc problem matcher
294
292
run : echo "::add-matcher::.github/problem-matchers/gcc.json"
295
- - name : Install Dependencies
293
+ - name : Install dependencies
296
294
run : sudo ./.github/workflows/posix-deps-apt.sh
297
295
- name : Configure OpenSSL env vars
298
296
run : |
@@ -326,18 +324,18 @@ jobs:
326
324
327
325
build_wasi :
328
326
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'
331
329
uses : ./.github/workflows/reusable-wasi.yml
332
330
with :
333
- config_hash : ${{ needs.check_source .outputs.config_hash }}
331
+ config_hash : ${{ needs.build-context .outputs.config-hash }}
334
332
335
333
test_hypothesis :
336
334
name : " Hypothesis tests on Ubuntu"
337
335
runs-on : ubuntu-24.04
338
336
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'
341
339
env :
342
340
OPENSSL_VER : 3.0.15
343
341
PYTHONSTRICTEXTENSIONBUILD : 1
@@ -347,7 +345,7 @@ jobs:
347
345
persist-credentials : false
348
346
- name : Register gcc problem matcher
349
347
run : echo "::add-matcher::.github/problem-matchers/gcc.json"
350
- - name : Install Dependencies
348
+ - name : Install dependencies
351
349
run : sudo ./.github/workflows/posix-deps-apt.sh
352
350
- name : Configure OpenSSL env vars
353
351
run : |
@@ -379,12 +377,12 @@ jobs:
379
377
- name : Bind mount sources read-only
380
378
run : sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
381
379
- name : Runner image version
382
- run : echo "IMAGE_VERSION= ${ImageVersion}" >> "$GITHUB_ENV"
380
+ run : echo "IMAGE_OS_VERSION=${ImageOS}- ${ImageVersion}" >> "$GITHUB_ENV"
383
381
- name : Restore config.cache
384
382
uses : actions/cache@v4
385
383
with :
386
384
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 }}
388
386
- name : Configure CPython out-of-tree
389
387
working-directory : ${{ env.CPYTHON_BUILDDIR }}
390
388
run : |
@@ -452,8 +450,8 @@ jobs:
452
450
name : ' Address sanitizer'
453
451
runs-on : ${{ matrix.os }}
454
452
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'
457
455
strategy :
458
456
matrix :
459
457
os : [ubuntu-24.04]
@@ -466,15 +464,15 @@ jobs:
466
464
with :
467
465
persist-credentials : false
468
466
- name : Runner image version
469
- run : echo "IMAGE_VERSION= ${ImageVersion}" >> "$GITHUB_ENV"
467
+ run : echo "IMAGE_OS_VERSION=${ImageOS}- ${ImageVersion}" >> "$GITHUB_ENV"
470
468
- name : Restore config.cache
471
469
uses : actions/cache@v4
472
470
with :
473
471
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 }}
475
473
- name : Register gcc problem matcher
476
474
run : echo "::add-matcher::.github/problem-matchers/gcc.json"
477
- - name : Install Dependencies
475
+ - name : Install dependencies
478
476
run : sudo ./.github/workflows/posix-deps-apt.sh
479
477
- name : Set up GCC-10 for ASAN
480
478
uses : egor-tensin/setup-gcc@v1
@@ -515,41 +513,41 @@ jobs:
515
513
name : >-
516
514
Thread sanitizer
517
515
${{ 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'
520
518
strategy :
521
519
matrix :
522
520
free-threading :
523
521
- false
524
522
- true
525
523
uses : ./.github/workflows/reusable-tsan.yml
526
524
with :
527
- config_hash : ${{ needs.check_source .outputs.config_hash }}
525
+ config_hash : ${{ needs.build-context .outputs.config-hash }}
528
526
free-threading : ${{ matrix.free-threading }}
529
527
530
528
cross-build-linux :
531
529
name : Cross build Linux
532
530
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'
535
533
steps :
536
534
- uses : actions/checkout@v4
537
535
with :
538
536
persist-credentials : false
539
537
- name : Runner image version
540
- run : echo "IMAGE_VERSION= ${ImageVersion}" >> "$GITHUB_ENV"
538
+ run : echo "IMAGE_OS_VERSION=${ImageOS}- ${ImageVersion}" >> "$GITHUB_ENV"
541
539
- name : Restore config.cache
542
540
uses : actions/cache@v4
543
541
with :
544
542
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 }}
546
544
- name : Register gcc problem matcher
547
545
run : echo "::add-matcher::.github/problem-matchers/gcc.json"
548
546
- name : Set build dir
549
547
run :
550
548
# an absolute path outside of the working directoy
551
549
echo "BUILD_DIR=$(realpath ${{ github.workspace }}/../build)" >> "$GITHUB_ENV"
552
- - name : Install Dependencies
550
+ - name : Install dependencies
553
551
run : sudo ./.github/workflows/posix-deps-apt.sh
554
552
- name : Configure host build
555
553
run : ./configure --prefix="$BUILD_DIR/host-python"
@@ -571,8 +569,8 @@ jobs:
571
569
name : CIFuzz
572
570
runs-on : ubuntu-latest
573
571
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'
576
574
permissions :
577
575
security-events : write
578
576
strategy :
@@ -611,7 +609,7 @@ jobs:
611
609
if : always()
612
610
613
611
needs :
614
- - check_source # Transitive dependency, needed to access `run_tests ` value
612
+ - build-context # Transitive dependency, needed to access `run-tests ` value
615
613
- check-docs
616
614
- check_autoconf_regen
617
615
- check_generated_files
@@ -621,6 +619,7 @@ jobs:
621
619
- build_wasi
622
620
- build_windows
623
621
- build_windows_msi
622
+ - cross-build-linux
624
623
- test_hypothesis
625
624
- build_asan
626
625
- build_tsan
@@ -639,38 +638,39 @@ jobs:
639
638
test_hypothesis,
640
639
allowed-skips : >-
641
640
${{
642
- !fromJSON(needs.check_source .outputs.run-docs)
641
+ !fromJSON(needs.build-context .outputs.run-docs)
643
642
&& '
644
643
check-docs,
645
644
'
646
645
|| ''
647
646
}}
648
647
${{
649
- needs.check_source .outputs.run_tests != 'true'
648
+ needs.build-context .outputs.run-tests != 'true'
650
649
&& '
651
650
check_autoconf_regen,
652
651
check_generated_files,
653
652
build_macos,
654
653
build_ubuntu,
655
654
build_ubuntu_ssltests,
656
655
build_wasi,
657
- build_windows,
658
656
build_asan,
659
657
build_tsan,
658
+ test_hypothesis,
659
+ cross-build-linux,
660
660
'
661
661
|| ''
662
662
}}
663
663
${{
664
- !fromJSON(needs.check_source .outputs.run_cifuzz )
664
+ !fromJSON(needs.build-context .outputs.run-windows-tests )
665
665
&& '
666
- cifuzz ,
666
+ build_windows ,
667
667
'
668
668
|| ''
669
669
}}
670
670
${{
671
- !fromJSON(needs.check_source .outputs.run_hypothesis )
671
+ !fromJSON(needs.build-context .outputs.run-ci-fuzz )
672
672
&& '
673
- test_hypothesis ,
673
+ cifuzz ,
674
674
'
675
675
|| ''
676
676
}}
0 commit comments