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
@@ -110,7 +108,7 @@ jobs:
110
108
needs : check_source
111
109
if : needs.check_source.outputs.run_tests == 'true'
112
110
steps :
113
- - uses : actions/checkout@v3
111
+ - uses : actions/checkout@v4
114
112
- uses : actions/setup-python@v4
115
113
- name : Install dependencies
116
114
run : |
@@ -149,18 +147,22 @@ jobs:
149
147
150
148
check_generated_files :
151
149
name : ' Check if generated files are up to date'
152
- runs-on : ubuntu-latest
150
+ # Don't use ubuntu-latest but a specific version to make the job
151
+ # reproducible: to get the same tools versions (autoconf, aclocal, ...)
152
+ runs-on : ubuntu-22.04
153
153
timeout-minutes : 60
154
154
needs : check_source
155
155
if : needs.check_source.outputs.run_tests == 'true'
156
156
steps :
157
157
- uses : actions/checkout@v4
158
+ - uses : actions/setup-python@v4
159
+ with :
160
+ python-version : ' 3.x'
158
161
- name : Restore config.cache
159
162
uses : actions/cache@v3
160
163
with :
161
164
path : config.cache
162
- key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
163
- - uses : actions/setup-python@v4
165
+ key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
164
166
- name : Install Dependencies
165
167
run : sudo ./.github/workflows/posix-deps-apt.sh
166
168
- name : Add ccache to PATH
@@ -170,15 +172,16 @@ jobs:
170
172
- name : Check Autoconf and aclocal versions
171
173
run : |
172
174
grep "Generated by GNU Autoconf 2.71" configure
173
- grep "aclocal 1.16.4 " aclocal.m4
175
+ grep "aclocal 1.16.5 " aclocal.m4
174
176
grep -q "runstatedir" configure
175
177
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
176
178
- name : Configure CPython
177
179
run : |
178
180
# Build Python with the libpython dynamic library
179
181
./configure --config-cache --with-pydebug --enable-shared
180
- - name : Regenerate autoconf files with container image
181
- run : make regen-configure
182
+ - name : Regenerate autoconf files
183
+ # Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
184
+ run : autoreconf -ivf -Werror
182
185
- name : Build CPython
183
186
run : |
184
187
# Deepfreeze will usually cause global objects to be added or removed,
@@ -208,144 +211,32 @@ jobs:
208
211
if : github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
209
212
run : make check-c-globals
210
213
211
- build_win32 :
212
- name : ' Windows (x86)'
213
- runs-on : windows-latest
214
- timeout-minutes : 60
214
+ build_windows :
215
+ name : ' Windows'
215
216
needs : check_source
216
217
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
218
+ uses : ./.github/workflows/reusable-windows.yml
246
219
247
220
build_macos :
248
221
name : ' macOS'
249
- runs-on : macos-latest
250
- timeout-minutes : 60
251
222
needs : check_source
252
223
if : needs.check_source.outputs.run_tests == 'true'
253
- env :
254
- HOMEBREW_NO_ANALYTICS : 1
255
- HOMEBREW_NO_AUTO_UPDATE : 1
256
- HOMEBREW_NO_INSTALL_CLEANUP : 1
257
- PYTHONSTRICTEXTENSIONBUILD : 1
258
- steps :
259
- - uses : actions/checkout@v4
260
- - name : Restore config.cache
261
- uses : actions/cache@v3
262
- with :
263
- path : config.cache
264
- key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
265
- - name : Install Homebrew dependencies
266
- run :
brew install pkg-config [email protected] xz gdbm tcl-tk
267
- - name : Configure CPython
268
- run : |
269
- GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
270
- GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
271
- ./configure \
272
- --config-cache \
273
- --with-pydebug \
274
- --prefix=/opt/python-dev \
275
- --with-openssl="$(brew --prefix [email protected] )"
276
- - name : Build CPython
277
- run : make -j4
278
- - name : Display build info
279
- run : make pythoninfo
280
- - name : Tests
281
- run : make buildbottest TESTOPTS="-j4 -uall,-cpu"
224
+ uses : ./.github/workflows/reusable-macos.yml
225
+ with :
226
+ config_hash : ${{ needs.check_source.outputs.config_hash }}
282
227
283
228
build_ubuntu :
284
229
name : ' Ubuntu'
285
- runs-on : ubuntu-20.04
286
- timeout-minutes : 60
287
230
needs : check_source
288
231
if : needs.check_source.outputs.run_tests == 'true'
289
- env :
290
- OPENSSL_VER : 1.1.1v
291
- PYTHONSTRICTEXTENSIONBUILD : 1
292
- steps :
293
- - uses : actions/checkout@v4
294
- - name : Register gcc problem matcher
295
- run : echo "::add-matcher::.github/problem-matchers/gcc.json"
296
- - name : Install Dependencies
297
- run : sudo ./.github/workflows/posix-deps-apt.sh
298
- - name : Configure OpenSSL env vars
299
- run : |
300
- echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
301
- echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
302
- echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
303
- - name : ' Restore OpenSSL build'
304
- id : cache-openssl
305
- uses : actions/cache@v3
306
- with :
307
- path : ./multissl/openssl/${{ env.OPENSSL_VER }}
308
- key : ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
309
- - name : Install OpenSSL
310
- if : steps.cache-openssl.outputs.cache-hit != 'true'
311
- run : python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
312
- - name : Add ccache to PATH
313
- run : |
314
- echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
315
- - name : Configure ccache action
316
- uses :
hendrikmuhs/[email protected]
317
- - name : Setup directory envs for out-of-tree builds
318
- run : |
319
- echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
320
- echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
321
- - name : Create directories for read-only out-of-tree builds
322
- run : mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
323
- - name : Bind mount sources read-only
324
- run : sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
325
- - name : Restore config.cache
326
- uses : actions/cache@v3
327
- with :
328
- path : ${{ env.CPYTHON_BUILDDIR }}/config.cache
329
- key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
330
- - name : Configure CPython out-of-tree
331
- working-directory : ${{ env.CPYTHON_BUILDDIR }}
332
- run : |
232
+ uses : ./.github/workflows/reusable-ubuntu.yml
233
+ with :
234
+ config_hash : ${{ needs.check_source.outputs.config_hash }}
235
+ options : |
333
236
../cpython-ro-srcdir/configure \
334
237
--config-cache \
335
238
--with-pydebug \
336
239
--with-openssl=$OPENSSL_DIR
337
- - name : Build CPython out-of-tree
338
- working-directory : ${{ env.CPYTHON_BUILDDIR }}
339
- run : make -j4
340
- - name : Display build info
341
- working-directory : ${{ env.CPYTHON_BUILDDIR }}
342
- run : make pythoninfo
343
- - name : Remount sources writable for tests
344
- # some tests write to srcdir, lack of pyc files slows down testing
345
- run : sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
346
- - name : Tests
347
- working-directory : ${{ env.CPYTHON_BUILDDIR }}
348
- run : xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
349
240
350
241
build_ubuntu_ssltests :
351
242
name : ' Ubuntu SSL tests with OpenSSL'
@@ -356,7 +247,7 @@ jobs:
356
247
strategy :
357
248
fail-fast : false
358
249
matrix :
359
- openssl_ver : [1.1.1v , 3.0.10 , 3.1.2 ]
250
+ openssl_ver : [1.1.1w , 3.0.11 , 3.1.3 ]
360
251
env :
361
252
OPENSSL_VER : ${{ matrix.openssl_ver }}
362
253
MULTISSL_DIR : ${{ github.workspace }}/multissl
@@ -408,13 +299,13 @@ jobs:
408
299
needs : check_source
409
300
if : needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
410
301
env :
411
- OPENSSL_VER : 1.1.1v
302
+ OPENSSL_VER : 3.0.11
412
303
PYTHONSTRICTEXTENSIONBUILD : 1
413
304
steps :
414
305
- uses : actions/checkout@v4
415
306
- name : Register gcc problem matcher
416
307
run : echo "::add-matcher::.github/problem-matchers/gcc.json"
417
- - name : Install Dependencies
308
+ - name : Install dependencies
418
309
run : sudo ./.github/workflows/posix-deps-apt.sh
419
310
- name : Configure OpenSSL env vars
420
311
run : |
@@ -517,7 +408,7 @@ jobs:
517
408
needs : check_source
518
409
if : needs.check_source.outputs.run_tests == 'true'
519
410
env :
520
- OPENSSL_VER : 1.1.1v
411
+ OPENSSL_VER : 3.0.11
521
412
PYTHONSTRICTEXTENSIONBUILD : 1
522
413
ASAN_OPTIONS : detect_leaks=0:allocator_may_return_null=1:handle_segv=0
523
414
steps :
@@ -571,11 +462,10 @@ jobs:
571
462
- check_source # Transitive dependency, needed to access `run_tests` value
572
463
- check-docs
573
464
- check_generated_files
574
- - build_win32
575
- - build_win_amd64
576
465
- build_macos
577
466
- build_ubuntu
578
467
- build_ubuntu_ssltests
468
+ - build_windows
579
469
- test_hypothesis
580
470
- build_asan
581
471
@@ -588,7 +478,6 @@ jobs:
588
478
allowed-failures : >-
589
479
build_macos,
590
480
build_ubuntu_ssltests,
591
- build_win32,
592
481
test_hypothesis,
593
482
allowed-skips : >-
594
483
${{
@@ -602,11 +491,10 @@ jobs:
602
491
needs.check_source.outputs.run_tests != 'true'
603
492
&& '
604
493
check_generated_files,
605
- build_win32,
606
- build_win_amd64,
607
494
build_macos,
608
495
build_ubuntu,
609
496
build_ubuntu_ssltests,
497
+ build_windows,
610
498
build_asan,
611
499
'
612
500
|| ''
0 commit comments