@@ -108,7 +108,7 @@ jobs:
108
108
needs : check_source
109
109
if : needs.check_source.outputs.run_tests == 'true'
110
110
steps :
111
- - uses : actions/checkout@v3
111
+ - uses : actions/checkout@v4
112
112
- uses : actions/setup-python@v4
113
113
- name : Install dependencies
114
114
run : |
@@ -208,159 +208,32 @@ jobs:
208
208
if : github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
209
209
run : make check-c-globals
210
210
211
- build_win32 :
212
- name : ' Windows (x86)'
213
- runs-on : windows-latest
214
- timeout-minutes : 60
211
+ build_windows :
212
+ name : ' Windows'
215
213
needs : check_source
216
214
if : needs.check_source.outputs.run_tests == 'true'
217
- env :
218
- IncludeUwp : ' true'
219
- steps :
220
- - uses : actions/checkout@v4
221
- - name : Build CPython
222
- run : .\PCbuild\build.bat -e -d -p Win32
223
- - name : Display build info
224
- run : .\python.bat -m test.pythoninfo
225
- - name : Tests
226
- run : .\PCbuild\rt.bat -p Win32 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
227
-
228
- build_win_amd64 :
229
- name : ' Windows (x64)'
230
- runs-on : windows-latest
231
- timeout-minutes : 60
232
- needs : check_source
233
- if : needs.check_source.outputs.run_tests == 'true'
234
- env :
235
- IncludeUwp : ' true'
236
- steps :
237
- - uses : actions/checkout@v4
238
- - name : Register MSVC problem matcher
239
- run : echo "::add-matcher::.github/problem-matchers/msvc.json"
240
- - name : Build CPython
241
- run : .\PCbuild\build.bat -e -d -p x64
242
- - name : Display build info
243
- run : .\python.bat -m test.pythoninfo
244
- - name : Tests
245
- run : .\PCbuild\rt.bat -p x64 -d -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
246
-
247
- build_win_arm64 :
248
- name : ' Windows (arm64)'
249
- runs-on : windows-latest
250
- timeout-minutes : 60
251
- needs : check_source
252
- if : needs.check_source.outputs.run_tests == 'true'
253
- env :
254
- IncludeUwp : ' true'
255
- steps :
256
- - uses : actions/checkout@v4
257
- - name : Register MSVC problem matcher
258
- run : echo "::add-matcher::.github/problem-matchers/msvc.json"
259
- - name : Build CPython
260
- run : .\PCbuild\build.bat -e -d -p arm64
215
+ uses : ./.github/workflows/reusable-windows.yml
261
216
262
217
build_macos :
263
218
name : ' macOS'
264
- runs-on : macos-latest
265
- timeout-minutes : 60
266
219
needs : check_source
267
220
if : needs.check_source.outputs.run_tests == 'true'
268
- env :
269
- HOMEBREW_NO_ANALYTICS : 1
270
- HOMEBREW_NO_AUTO_UPDATE : 1
271
- HOMEBREW_NO_INSTALL_CLEANUP : 1
272
- PYTHONSTRICTEXTENSIONBUILD : 1
273
- steps :
274
- - uses : actions/checkout@v4
275
- - name : Restore config.cache
276
- uses : actions/cache@v3
277
- with :
278
- path : config.cache
279
- key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
280
- - name : Install Homebrew dependencies
281
- run : brew install pkg-config openssl@3.0 xz gdbm tcl-tk
282
- - name : Configure CPython
283
- run : |
284
- GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
285
- GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
286
- ./configure \
287
- --config-cache \
288
- --with-pydebug \
289
- --prefix=/opt/python-dev \
290
- --with-openssl="$(brew --prefix openssl@3.0)"
291
- - name : Build CPython
292
- run : make -j4
293
- - name : Display build info
294
- run : make pythoninfo
295
- - name : Tests
296
- run : make buildbottest TESTOPTS="-j4 -uall,-cpu"
221
+ uses : ./.github/workflows/reusable-macos.yml
222
+ with :
223
+ config_hash : ${{ needs.check_source.outputs.config_hash }}
297
224
298
225
build_ubuntu :
299
226
name : ' Ubuntu'
300
- runs-on : ubuntu-20.04
301
- timeout-minutes : 60
302
227
needs : check_source
303
228
if : needs.check_source.outputs.run_tests == 'true'
304
- env :
305
- OPENSSL_VER : 3.0.11
306
- PYTHONSTRICTEXTENSIONBUILD : 1
307
- steps :
308
- - uses : actions/checkout@v4
309
- - name : Register gcc problem matcher
310
- run : echo "::add-matcher::.github/problem-matchers/gcc.json"
311
- - name : Install dependencies
312
- run : sudo ./.github/workflows/posix-deps-apt.sh
313
- - name : Configure OpenSSL env vars
314
- run : |
315
- echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
316
- echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
317
- echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
318
- - name : ' Restore OpenSSL build'
319
- id : cache-openssl
320
- uses : actions/cache@v3
321
- with :
322
- path : ./multissl/openssl/${{ env.OPENSSL_VER }}
323
- key : ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
324
- - name : Install OpenSSL
325
- if : steps.cache-openssl.outputs.cache-hit != 'true'
326
- run : python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
327
- - name : Add ccache to PATH
328
- run : |
329
- echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
330
- - name : Configure ccache action
331
- uses : hendrikmuhs/ccache-action@v1.2
332
- - name : Setup directory envs for out-of-tree builds
333
- run : |
334
- echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
335
- echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
336
- - name : Create directories for read-only out-of-tree builds
337
- run : mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
338
- - name : Bind mount sources read-only
339
- run : sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
340
- - name : Restore config.cache
341
- uses : actions/cache@v3
342
- with :
343
- path : ${{ env.CPYTHON_BUILDDIR }}/config.cache
344
- key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
345
- - name : Configure CPython out-of-tree
346
- working-directory : ${{ env.CPYTHON_BUILDDIR }}
347
- run : |
229
+ uses : ./.github/workflows/reusable-ubuntu.yml
230
+ with :
231
+ config_hash : ${{ needs.check_source.outputs.config_hash }}
232
+ options : |
348
233
../cpython-ro-srcdir/configure \
349
234
--config-cache \
350
235
--with-pydebug \
351
236
--with-openssl=$OPENSSL_DIR
352
- - name : Build CPython out-of-tree
353
- working-directory : ${{ env.CPYTHON_BUILDDIR }}
354
- run : make -j4
355
- - name : Display build info
356
- working-directory : ${{ env.CPYTHON_BUILDDIR }}
357
- run : make pythoninfo
358
- - name : Remount sources writable for tests
359
- # some tests write to srcdir, lack of pyc files slows down testing
360
- run : sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
361
- - name : Tests
362
- working-directory : ${{ env.CPYTHON_BUILDDIR }}
363
- run : xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
364
237
365
238
build_ubuntu_ssltests :
366
239
name : ' Ubuntu SSL tests with OpenSSL'
@@ -429,7 +302,7 @@ jobs:
429
302
- uses : actions/checkout@v4
430
303
- name : Register gcc problem matcher
431
304
run : echo "::add-matcher::.github/problem-matchers/gcc.json"
432
- - name : Install Dependencies
305
+ - name : Install dependencies
433
306
run : sudo ./.github/workflows/posix-deps-apt.sh
434
307
- name : Configure OpenSSL env vars
435
308
run : |
@@ -586,12 +459,10 @@ jobs:
586
459
- check_source # Transitive dependency, needed to access `run_tests` value
587
460
- check-docs
588
461
- check_generated_files
589
- - build_win32
590
- - build_win_amd64
591
- - build_win_arm64
592
462
- build_macos
593
463
- build_ubuntu
594
464
- build_ubuntu_ssltests
465
+ - build_windows
595
466
- test_hypothesis
596
467
- build_asan
597
468
@@ -604,8 +475,6 @@ jobs:
604
475
allowed-failures : >-
605
476
build_macos,
606
477
build_ubuntu_ssltests,
607
- build_win32,
608
- build_win_arm64,
609
478
test_hypothesis,
610
479
allowed-skips : >-
611
480
${{
@@ -619,12 +488,10 @@ jobs:
619
488
needs.check_source.outputs.run_tests != 'true'
620
489
&& '
621
490
check_generated_files,
622
- build_win32,
623
- build_win_amd64,
624
- build_win_arm64,
625
491
build_macos,
626
492
build_ubuntu,
627
493
build_ubuntu_ssltests,
494
+ build_windows,
628
495
build_asan,
629
496
'
630
497
|| ''
0 commit comments