@@ -27,11 +27,31 @@ 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_tests : ${{ steps.check.outputs.run_tests || false }}
52+ run_hypothesis : ${{ steps.check.outputs.run_hypothesis || false }}
53+ run_cifuzz : ${{ steps.check.outputs.run_cifuzz || false }}
54+ config_hash : ${{ steps.config_hash.outputs.hash }} # str
3555 steps :
3656 - uses : actions/checkout@v4
3757 - name : Check for source changes
@@ -179,18 +199,24 @@ jobs:
179199 run : make check-c-globals
180200
181201 build_windows :
182- name : ' Windows'
202+ name : >-
203+ Windows
204+ ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
183205 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)'
189- needs : check_source
190- if : needs.check_source.outputs.run_tests == 'true'
206+ if : fromJSON(needs.check_source.outputs.run_tests)
207+ strategy :
208+ matrix :
209+ arch :
210+ - Win32
211+ - x64
212+ - arm64
213+ free-threading :
214+ - false
215+ - true
191216 uses : ./.github/workflows/reusable-windows.yml
192217 with :
193- free-threading : true
218+ arch : ${{ matrix.arch }}
219+ free-threading : ${{ matrix.free-threading }}
194220
195221 build_macos :
196222 name : ' macOS'
@@ -393,7 +419,7 @@ jobs:
393419 path : ${{ env.CPYTHON_BUILDDIR }}/.hypothesis/
394420 key : hypothesis-database-${{ github.head_ref || github.run_id }}
395421 restore-keys : |
396- - hypothesis-database-
422+ hypothesis-database-
397423 - name : " Run tests"
398424 working-directory : ${{ env.CPYTHON_BUILDDIR }}
399425 run : |
@@ -556,7 +582,6 @@ jobs:
556582 - build_ubuntu_ssltests
557583 - build_wasi
558584 - build_windows
559- - build_windows_free_threading
560585 - test_hypothesis
561586 - build_asan
562587 - build_tsan
@@ -592,7 +617,6 @@ jobs:
592617 build_ubuntu_ssltests,
593618 build_wasi,
594619 build_windows,
595- build_windows_free_threading,
596620 build_asan,
597621 build_tsan,
598622 build_tsan_free_threading,
0 commit comments