@@ -27,11 +27,32 @@ jobs:
27
27
runs-on : ubuntu-latest
28
28
timeout-minutes : 10
29
29
outputs :
30
+ # Some of the referenced steps set outputs conditionally and there may be
31
+ # cases when referencing them evaluates to empty strings. It is nice to
32
+ # work with proper booleans so they have to be evaluated through JSON
33
+ # conversion in the expressions. However, empty strings used like that
34
+ # may trigger all sorts of undefined and hard-to-debug behaviors in
35
+ # GitHub Actions CI/CD. To help with this, all of the outputs set here
36
+ # that are meant to be used as boolean flags (and not arbitrary strings),
37
+ # MUST have fallbacks with default values set. A common pattern would be
38
+ # to add ` || false` to all such expressions here, in the output
39
+ # definitions. They can then later be safely used through the following
40
+ # idiom in job conditionals and other expressions. Here's some examples:
41
+ #
42
+ # if: fromJSON(needs.check_source.outputs.run-docs)
43
+ #
44
+ # ${{
45
+ # fromJSON(needs.check_source.outputs.run_tests)
46
+ # && 'truthy-branch'
47
+ # || 'falsy-branch'
48
+ # }}
49
+ #
30
50
run-docs : ${{ steps.docs-changes.outputs.run-docs || false }}
31
- run_tests : ${{ steps.check.outputs.run_tests }}
32
- run_hypothesis : ${{ steps.check.outputs.run_hypothesis }}
33
- run_cifuzz : ${{ steps.check.outputs.run_cifuzz }}
34
- config_hash : ${{ steps.config_hash.outputs.hash }}
51
+ run-win-msi : ${{ steps.win-msi-changes.outputs.run-win-msi || false }}
52
+ run_tests : ${{ steps.check.outputs.run_tests || false }}
53
+ run_hypothesis : ${{ steps.check.outputs.run_hypothesis || false }}
54
+ run_cifuzz : ${{ steps.check.outputs.run_cifuzz || false }}
55
+ config_hash : ${{ steps.config_hash.outputs.hash }} # str
35
56
steps :
36
57
- uses : actions/checkout@v4
37
58
- name : Check for source changes
@@ -103,6 +124,20 @@ jobs:
103
124
id : docs-changes
104
125
run : |
105
126
echo "run-docs=true" >> "${GITHUB_OUTPUT}"
127
+ - name : Get a list of the MSI installer-related files
128
+ id : changed-win-msi-files
129
+
130
+ with :
131
+ filter : |
132
+ Tools/msi/**
133
+ .github/workflows/reusable-windows-msi.yml
134
+ format : csv # works for paths with spaces
135
+ - name : Check for changes in MSI installer-related files
136
+ if : >-
137
+ steps.changed-win-msi-files.outputs.added_modified_renamed != ''
138
+ id : win-msi-changes
139
+ run : |
140
+ echo "run-win-msi=true" >> "${GITHUB_OUTPUT}"
106
141
107
142
check-docs :
108
143
name : Docs
@@ -179,68 +214,89 @@ jobs:
179
214
run : make check-c-globals
180
215
181
216
build_windows :
182
- name : ' Windows'
183
- needs : check_source
184
- if : needs.check_source.outputs.run_tests == 'true'
185
- uses : ./.github/workflows/reusable-windows.yml
186
-
187
- build_windows_free_threading :
188
- name : ' Windows (free-threading)'
217
+ name : >-
218
+ Windows
219
+ ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
189
220
needs : check_source
190
- if : needs.check_source.outputs.run_tests == 'true'
221
+ if : fromJSON(needs.check_source.outputs.run_tests)
222
+ strategy :
223
+ matrix :
224
+ arch :
225
+ - Win32
226
+ - x64
227
+ - arm64
228
+ free-threading :
229
+ - false
230
+ - true
191
231
uses : ./.github/workflows/reusable-windows.yml
192
232
with :
193
- free-threading : true
233
+ arch : ${{ matrix.arch }}
234
+ free-threading : ${{ matrix.free-threading }}
194
235
195
- build_macos :
196
- name : ' macOS'
236
+ build_windows_msi :
237
+ name : >- # ${{ '' } is a hack to nest jobs under the same sidebar category
238
+ Windows MSI${{ '' }}
197
239
needs : check_source
198
- if : needs.check_source.outputs.run_tests == 'true'
199
- uses : ./.github/workflows/reusable-macos.yml
240
+ if : fromJSON(needs.check_source.outputs.run-win-msi)
241
+ strategy :
242
+ matrix :
243
+ arch :
244
+ - x86
245
+ - x64
246
+ - arm64
247
+ uses : ./.github/workflows/reusable-windows-msi.yml
200
248
with :
201
- config_hash : ${{ needs.check_source.outputs.config_hash }}
202
- # Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
203
- # Cirrus used for upstream, macos-14 for forks.
204
- os-matrix : ' ["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14", "macos-13"]'
249
+ arch : ${{ matrix.arch }}
205
250
206
- build_macos_free_threading :
207
- name : ' macOS (free-threading)'
251
+ build_macos :
252
+ name : >-
253
+ macOS
254
+ ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
208
255
needs : check_source
209
256
if : needs.check_source.outputs.run_tests == 'true'
257
+ strategy :
258
+ fail-fast : false
259
+ matrix :
260
+ # Cirrus and macos-14 are M1, macos-13 is default GHA Intel.
261
+ # macOS 13 only runs tests against the GIL-enabled CPython.
262
+ # Cirrus used for upstream, macos-14 for forks.
263
+ os :
264
+ - ghcr.io/cirruslabs/macos-runner:sonoma
265
+ - macos-14
266
+ - macos-13
267
+ is-fork : # only used for the exclusion trick
268
+ - ${{ github.repository_owner != 'python' }}
269
+ free-threading :
270
+ - false
271
+ - true
272
+ exclude :
273
+ - os : ghcr.io/cirruslabs/macos-runner:sonoma
274
+ is-fork : true
275
+ - os : macos-14
276
+ is-fork : false
277
+ - os : macos-13
278
+ free-threading : true
210
279
uses : ./.github/workflows/reusable-macos.yml
211
280
with :
212
281
config_hash : ${{ needs.check_source.outputs.config_hash }}
213
- free-threading : true
214
- # Cirrus and macos-14 are M1.
215
- # Cirrus used for upstream, macos-14 for forks.
216
- os-matrix : ' ["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
282
+ free-threading : ${{ matrix.free-threading }}
283
+ os : ${{ matrix.os }}
217
284
218
285
build_ubuntu :
219
- name : ' Ubuntu'
220
- needs : check_source
221
- if : needs.check_source.outputs.run_tests == 'true'
222
- uses : ./.github/workflows/reusable-ubuntu.yml
223
- with :
224
- config_hash : ${{ needs.check_source.outputs.config_hash }}
225
- options : |
226
- ../cpython-ro-srcdir/configure \
227
- --config-cache \
228
- --with-pydebug \
229
- --with-openssl=$OPENSSL_DIR
230
-
231
- build_ubuntu_free_threading :
232
- name : ' Ubuntu (free-threading)'
286
+ name : >-
287
+ Ubuntu
288
+ ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
233
289
needs : check_source
234
290
if : needs.check_source.outputs.run_tests == 'true'
291
+ strategy :
292
+ matrix :
293
+ free-threading :
294
+ - false
295
+ - true
235
296
uses : ./.github/workflows/reusable-ubuntu.yml
236
297
with :
237
298
config_hash : ${{ needs.check_source.outputs.config_hash }}
238
- options : |
239
- ../cpython-ro-srcdir/configure \
240
- --config-cache \
241
- --with-pydebug \
242
- --with-openssl=$OPENSSL_DIR \
243
- --disable-gil
299
+ free-threading : ${{ matrix.free-threading }}
244
300
245
301
build_ubuntu_ssltests :
246
302
name : ' Ubuntu SSL tests with OpenSSL'
@@ -292,7 +348,7 @@ jobs:
292
348
with :
293
349
save : false
294
350
- name : Configure CPython
295
- run : ./configure -- config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
351
+ run : ./configure CFLAGS="-fdiagnostics-format=json" -- config-cache --enable-slower-safety --with-pydebug --with-openssl=$OPENSSL_DIR
296
352
- name : Build CPython
297
353
run : make -j4
298
354
- name : Display build info
@@ -365,6 +421,7 @@ jobs:
365
421
../cpython-ro-srcdir/configure \
366
422
--config-cache \
367
423
--with-pydebug \
424
+ --enable-slower-safety \
368
425
--with-openssl=$OPENSSL_DIR
369
426
- name : Build CPython out-of-tree
370
427
working-directory : ${{ env.CPYTHON_BUILDDIR }}
@@ -393,7 +450,7 @@ jobs:
393
450
path : ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/
394
451
key : hypothesis-database-${{ github.head_ref || github.run_id }}
395
452
restore-keys : |
396
- - hypothesis-database-
453
+ hypothesis-database-
397
454
- name : " Run tests"
398
455
working-directory : ${{ env.CPYTHON_BUILDDIR }}
399
456
run : |
@@ -550,13 +607,11 @@ jobs:
550
607
- check-docs
551
608
- check_generated_files
552
609
- build_macos
553
- - build_macos_free_threading
554
610
- build_ubuntu
555
- - build_ubuntu_free_threading
556
611
- build_ubuntu_ssltests
557
612
- build_wasi
558
613
- build_windows
559
- - build_windows_free_threading
614
+ - build_windows_msi
560
615
- test_hypothesis
561
616
- build_asan
562
617
- build_tsan
@@ -571,6 +626,7 @@ jobs:
571
626
with :
572
627
allowed-failures : >-
573
628
build_ubuntu_ssltests,
629
+ build_windows_msi,
574
630
cifuzz,
575
631
test_hypothesis,
576
632
allowed-skips : >-
@@ -586,13 +642,10 @@ jobs:
586
642
&& '
587
643
check_generated_files,
588
644
build_macos,
589
- build_macos_free_threading,
590
645
build_ubuntu,
591
- build_ubuntu_free_threading,
592
646
build_ubuntu_ssltests,
593
647
build_wasi,
594
648
build_windows,
595
- build_windows_free_threading,
596
649
build_asan,
597
650
build_tsan,
598
651
build_tsan_free_threading,
0 commit comments