@@ -27,11 +27,32 @@ jobs:
2727 runs-on : ubuntu-latest
2828 timeout-minutes : 10
2929 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+ #
3050 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
3556 steps :
3657 - uses : actions/checkout@v4
3758 - name : Check for source changes
@@ -103,6 +124,20 @@ jobs:
103124 id : docs-changes
104125 run : |
105126 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}"
106141
107142 check-docs :
108143 name : Docs
@@ -179,18 +214,39 @@ jobs:
179214 run : make check-c-globals
180215
181216 build_windows :
182- name : ' Windows'
217+ name : >-
218+ Windows
219+ ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
183220 needs : check_source
184- 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
185231 uses : ./.github/workflows/reusable-windows.yml
232+ with :
233+ arch : ${{ matrix.arch }}
234+ free-threading : ${{ matrix.free-threading }}
186235
187- build_windows_free_threading :
188- name : ' Windows (free-threading)'
236+ build_windows_msi :
237+ name : >- # ${{ '' } is a hack to nest jobs under the same sidebar category
238+ Windows MSI${{ '' }}
189239 needs : check_source
190- if : needs.check_source.outputs.run_tests == 'true'
191- uses : ./.github/workflows/reusable-windows.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
192248 with :
193- free-threading : true
249+ arch : ${{ matrix.arch }}
194250
195251 build_macos :
196252 name : ' macOS'
@@ -216,31 +272,20 @@ jobs:
216272 os-matrix : ' ["ghcr.io/cirruslabs/macos-runner:sonoma", "macos-14"]'
217273
218274 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)'
275+ name : >-
276+ Ubuntu
277+ ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
233278 needs : check_source
234279 if : needs.check_source.outputs.run_tests == 'true'
280+ strategy :
281+ matrix :
282+ free-threading :
283+ - false
284+ - true
235285 uses : ./.github/workflows/reusable-ubuntu.yml
236286 with :
237287 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
288+ free-threading : ${{ matrix.free-threading }}
244289
245290 build_ubuntu_ssltests :
246291 name : ' Ubuntu SSL tests with OpenSSL'
@@ -292,7 +337,7 @@ jobs:
292337 with :
293338 save : false
294339 - name : Configure CPython
295- run : ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
340+ run : ./configure --config-cache --enable-slower-safety -- with-pydebug --with-openssl=$OPENSSL_DIR
296341 - name : Build CPython
297342 run : make -j4
298343 - name : Display build info
@@ -365,6 +410,7 @@ jobs:
365410 ../cpython-ro-srcdir/configure \
366411 --config-cache \
367412 --with-pydebug \
413+ --enable-slower-safety \
368414 --with-openssl=$OPENSSL_DIR
369415 - name : Build CPython out-of-tree
370416 working-directory : ${{ env.CPYTHON_BUILDDIR }}
@@ -393,7 +439,7 @@ jobs:
393439 path : ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/
394440 key : hypothesis-database-${{ github.head_ref || github.run_id }}
395441 restore-keys : |
396- - hypothesis-database-
442+ hypothesis-database-
397443 - name : " Run tests"
398444 working-directory : ${{ env.CPYTHON_BUILDDIR }}
399445 run : |
@@ -552,11 +598,10 @@ jobs:
552598 - build_macos
553599 - build_macos_free_threading
554600 - build_ubuntu
555- - build_ubuntu_free_threading
556601 - build_ubuntu_ssltests
557602 - build_wasi
558603 - build_windows
559- - build_windows_free_threading
604+ - build_windows_msi
560605 - test_hypothesis
561606 - build_asan
562607 - build_tsan
@@ -571,6 +616,7 @@ jobs:
571616 with :
572617 allowed-failures : >-
573618 build_ubuntu_ssltests,
619+ build_windows_msi,
574620 cifuzz,
575621 test_hypothesis,
576622 allowed-skips : >-
@@ -588,11 +634,9 @@ jobs:
588634 build_macos,
589635 build_macos_free_threading,
590636 build_ubuntu,
591- build_ubuntu_free_threading,
592637 build_ubuntu_ssltests,
593638 build_wasi,
594639 build_windows,
595- build_windows_free_threading,
596640 build_asan,
597641 build_tsan,
598642 build_tsan_free_threading,
0 commit comments