13
13
- ' 3.10'
14
14
- ' 3.9'
15
15
- ' 3.8'
16
- - ' 3.7'
17
16
pull_request :
18
17
branches :
19
18
- ' main'
22
21
- ' 3.10'
23
22
- ' 3.9'
24
23
- ' 3.8'
25
- - ' 3.7'
26
24
27
25
permissions :
28
26
contents : read
@@ -128,14 +126,14 @@ jobs:
128
126
if : needs.check_source.outputs.run_tests == 'true'
129
127
steps :
130
128
- uses : actions/checkout@v4
129
+ - uses : actions/setup-python@v4
130
+ with :
131
+ python-version : ' 3.x'
131
132
- name : Restore config.cache
132
133
uses : actions/cache@v3
133
134
with :
134
135
path : config.cache
135
- key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
136
- - uses : actions/setup-python@v4
137
- with :
138
- python-version : ' 3.x'
136
+ key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
139
137
- name : Install Dependencies
140
138
run : sudo ./.github/workflows/posix-deps-apt.sh
141
139
- name : Add ccache to PATH
@@ -180,159 +178,63 @@ jobs:
180
178
if : github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
181
179
run : make check-c-globals
182
180
183
- build_win32 :
184
- name : ' Windows (x86)'
185
- runs-on : windows-latest
186
- timeout-minutes : 60
181
+ build_windows :
182
+ name : ' Windows'
187
183
needs : check_source
188
184
if : needs.check_source.outputs.run_tests == 'true'
189
- env :
190
- IncludeUwp : ' true'
191
- steps :
192
- - uses : actions/checkout@v4
193
- - name : Build CPython
194
- run : .\PCbuild\build.bat -e -d -p Win32
195
- - name : Display build info
196
- run : .\python.bat -m test.pythoninfo
197
- - name : Tests
198
- run : .\PCbuild\rt.bat -p Win32 -d -q --fast-ci
185
+ uses : ./.github/workflows/reusable-windows.yml
199
186
200
- build_win_amd64 :
201
- name : ' Windows (x64)'
202
- runs-on : windows-latest
203
- timeout-minutes : 60
187
+ build_windows_free_threaded :
188
+ name : ' Windows (free-threaded)'
204
189
needs : check_source
205
- if : needs.check_source.outputs.run_tests == 'true'
206
- env :
207
- IncludeUwp : ' true'
208
- steps :
209
- - uses : actions/checkout@v4
210
- - name : Register MSVC problem matcher
211
- run : echo "::add-matcher::.github/problem-matchers/msvc.json"
212
- - name : Build CPython
213
- run : .\PCbuild\build.bat -e -d -p x64
214
- - name : Display build info
215
- run : .\python.bat -m test.pythoninfo
216
- - name : Tests
217
- run : .\PCbuild\rt.bat -p x64 -d -q --fast-ci
218
-
219
- build_win_arm64 :
220
- name : ' Windows (arm64)'
221
- runs-on : windows-latest
222
- timeout-minutes : 60
223
- needs : check_source
224
- if : needs.check_source.outputs.run_tests == 'true'
225
- env :
226
- IncludeUwp : ' true'
227
- steps :
228
- - uses : actions/checkout@v4
229
- - name : Register MSVC problem matcher
230
- run : echo "::add-matcher::.github/problem-matchers/msvc.json"
231
- - name : Build CPython
232
- run : .\PCbuild\build.bat -e -d -p arm64
190
+ if : needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded')
191
+ uses : ./.github/workflows/reusable-windows.yml
192
+ with :
193
+ free-threaded : true
233
194
234
195
build_macos :
235
196
name : ' macOS'
236
- runs-on : macos-latest
237
- timeout-minutes : 60
238
197
needs : check_source
239
198
if : needs.check_source.outputs.run_tests == 'true'
240
- env :
241
- HOMEBREW_NO_ANALYTICS : 1
242
- HOMEBREW_NO_AUTO_UPDATE : 1
243
- HOMEBREW_NO_INSTALL_CLEANUP : 1
244
- PYTHONSTRICTEXTENSIONBUILD : 1
245
- steps :
246
- - uses : actions/checkout@v4
247
- - name : Restore config.cache
248
- uses : actions/cache@v3
249
- with :
250
- path : config.cache
251
- key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
252
- - name : Install Homebrew dependencies
253
- run :
brew install pkg-config [email protected] xz gdbm tcl-tk
254
- - name : Configure CPython
255
- run : |
256
- GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
257
- GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
258
- ./configure \
259
- --config-cache \
260
- --with-pydebug \
261
- --prefix=/opt/python-dev \
262
- --with-openssl="$(brew --prefix [email protected] )"
263
- - name : Build CPython
264
- run : make -j4
265
- - name : Display build info
266
- run : make pythoninfo
267
- - name : Tests
268
- run : make test
199
+ uses : ./.github/workflows/reusable-macos.yml
200
+ with :
201
+ config_hash : ${{ needs.check_source.outputs.config_hash }}
202
+
203
+ build_macos_free_threaded :
204
+ name : ' macOS (free-threaded)'
205
+ needs : check_source
206
+ if : needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded')
207
+ uses : ./.github/workflows/reusable-macos.yml
208
+ with :
209
+ config_hash : ${{ needs.check_source.outputs.config_hash }}
210
+ free-threaded : true
269
211
270
212
build_ubuntu :
271
213
name : ' Ubuntu'
272
- runs-on : ubuntu-20.04
273
- timeout-minutes : 60
274
214
needs : check_source
275
215
if : needs.check_source.outputs.run_tests == 'true'
276
- env :
277
- OPENSSL_VER : 3.0.11
278
- PYTHONSTRICTEXTENSIONBUILD : 1
279
- steps :
280
- - uses : actions/checkout@v4
281
- - name : Register gcc problem matcher
282
- run : echo "::add-matcher::.github/problem-matchers/gcc.json"
283
- - name : Install Dependencies
284
- run : sudo ./.github/workflows/posix-deps-apt.sh
285
- - name : Configure OpenSSL env vars
286
- run : |
287
- echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
288
- echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
289
- echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
290
- - name : ' Restore OpenSSL build'
291
- id : cache-openssl
292
- uses : actions/cache@v3
293
- with :
294
- path : ./multissl/openssl/${{ env.OPENSSL_VER }}
295
- key : ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
296
- - name : Install OpenSSL
297
- if : steps.cache-openssl.outputs.cache-hit != 'true'
298
- run : python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
299
- - name : Add ccache to PATH
300
- run : |
301
- echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
302
- - name : Configure ccache action
303
- uses :
hendrikmuhs/[email protected]
304
- - name : Setup directory envs for out-of-tree builds
305
- run : |
306
- echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
307
- echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
308
- - name : Create directories for read-only out-of-tree builds
309
- run : mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
310
- - name : Bind mount sources read-only
311
- run : sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
312
- - name : Restore config.cache
313
- uses : actions/cache@v3
314
- with :
315
- path : ${{ env.CPYTHON_BUILDDIR }}/config.cache
316
- key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
317
- - name : Configure CPython out-of-tree
318
- working-directory : ${{ env.CPYTHON_BUILDDIR }}
319
- run : |
216
+ uses : ./.github/workflows/reusable-ubuntu.yml
217
+ with :
218
+ config_hash : ${{ needs.check_source.outputs.config_hash }}
219
+ options : |
320
220
../cpython-ro-srcdir/configure \
321
221
--config-cache \
322
222
--with-pydebug \
323
223
--with-openssl=$OPENSSL_DIR
324
- - name : Build CPython out-of-tree
325
- working-directory : ${{ env.CPYTHON_BUILDDIR }}
326
- run : make -j4
327
- - name : Display build info
328
- working-directory : ${{ env.CPYTHON_BUILDDIR }}
329
- run : make pythoninfo
330
- - name : Remount sources writable for tests
331
- # some tests write to srcdir, lack of pyc files slows down testing
332
- run : sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
333
- - name : Tests
334
- working-directory : ${{ env.CPYTHON_BUILDDIR }}
335
- run : xvfb-run make test
224
+
225
+ build_ubuntu_free_threaded :
226
+ name : ' Ubuntu (free-threaded)'
227
+ needs : check_source
228
+ if : needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded')
229
+ uses : ./.github/workflows/reusable-ubuntu.yml
230
+ with :
231
+ config_hash : ${{ needs.check_source.outputs.config_hash }}
232
+ options : |
233
+ ../cpython-ro-srcdir/configure \
234
+ --config-cache \
235
+ --with-pydebug \
236
+ --with-openssl=$OPENSSL_DIR \
237
+ --disable-gil
336
238
337
239
build_ubuntu_ssltests :
338
240
name : ' Ubuntu SSL tests with OpenSSL'
@@ -598,12 +500,13 @@ jobs:
598
500
- check_source # Transitive dependency, needed to access `run_tests` value
599
501
- check-docs
600
502
- check_generated_files
601
- - build_win32
602
- - build_win_amd64
603
- - build_win_arm64
604
503
- build_macos
504
+ - build_macos_free_threaded
605
505
- build_ubuntu
506
+ - build_ubuntu_free_threaded
606
507
- build_ubuntu_ssltests
508
+ - build_windows
509
+ - build_windows_free_threaded
607
510
- test_hypothesis
608
511
- build_asan
609
512
- cifuzz
@@ -615,10 +518,10 @@ jobs:
615
518
uses : re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
616
519
with :
617
520
allowed-failures : >-
618
- build_macos,
521
+ build_macos_free_threaded,
522
+ build_ubuntu_free_threaded,
619
523
build_ubuntu_ssltests,
620
- build_win32,
621
- build_win_arm64,
524
+ build_windows_free_threaded,
622
525
cifuzz,
623
526
test_hypothesis,
624
527
allowed-skips : >-
@@ -633,12 +536,13 @@ jobs:
633
536
needs.check_source.outputs.run_tests != 'true'
634
537
&& '
635
538
check_generated_files,
636
- build_win32,
637
- build_win_amd64,
638
- build_win_arm64,
639
539
build_macos,
540
+ build_macos_free_threaded,
640
541
build_ubuntu,
542
+ build_ubuntu_free_threaded,
641
543
build_ubuntu_ssltests,
544
+ build_windows,
545
+ build_windows_free_threaded,
642
546
build_asan,
643
547
'
644
548
|| ''
0 commit comments