1313 - ' 3.10'
1414 - ' 3.9'
1515 - ' 3.8'
16- - ' 3.7'
1716 pull_request :
1817 branches :
1918 - ' main'
2221 - ' 3.10'
2322 - ' 3.9'
2423 - ' 3.8'
25- - ' 3.7'
2624
2725permissions :
2826 contents : read
@@ -110,7 +108,7 @@ jobs:
110108 needs : check_source
111109 if : needs.check_source.outputs.run_tests == 'true'
112110 steps :
113- - uses : actions/checkout@v3
111+ - uses : actions/checkout@v4
114112 - uses : actions/setup-python@v4
115113 - name : Install dependencies
116114 run : |
@@ -149,18 +147,22 @@ jobs:
149147
150148 check_generated_files :
151149 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
153153 timeout-minutes : 60
154154 needs : check_source
155155 if : needs.check_source.outputs.run_tests == 'true'
156156 steps :
157157 - uses : actions/checkout@v4
158+ - uses : actions/setup-python@v4
159+ with :
160+ python-version : ' 3.x'
158161 - name : Restore config.cache
159162 uses : actions/cache@v3
160163 with :
161164 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 }}
164166 - name : Install Dependencies
165167 run : sudo ./.github/workflows/posix-deps-apt.sh
166168 - name : Add ccache to PATH
@@ -170,15 +172,16 @@ jobs:
170172 - name : Check Autoconf and aclocal versions
171173 run : |
172174 grep "Generated by GNU Autoconf 2.71" configure
173- grep "aclocal 1.16.4 " aclocal.m4
175+ grep "aclocal 1.16.5 " aclocal.m4
174176 grep -q "runstatedir" configure
175177 grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
176178 - name : Configure CPython
177179 run : |
178180 # Build Python with the libpython dynamic library
179181 ./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
182185 - name : Build CPython
183186 run : |
184187 # Deepfreeze will usually cause global objects to be added or removed,
@@ -208,144 +211,32 @@ jobs:
208211 if : github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
209212 run : make check-c-globals
210213
211- build_win32 :
212- name : ' Windows (x86)'
213- runs-on : windows-latest
214- timeout-minutes : 60
214+ build_windows :
215+ name : ' Windows'
215216 needs : check_source
216217 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
246219
247220 build_macos :
248221 name : ' macOS'
249- runs-on : macos-latest
250- timeout-minutes : 60
251222 needs : check_source
252223 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 openssl@3.0 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 openssl@3.0)"
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 }}
282227
283228 build_ubuntu :
284229 name : ' Ubuntu'
285- runs-on : ubuntu-20.04
286- timeout-minutes : 60
287230 needs : check_source
288231 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/ccache-action@v1.2
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 : |
333236 ../cpython-ro-srcdir/configure \
334237 --config-cache \
335238 --with-pydebug \
336239 --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"
349240
350241 build_ubuntu_ssltests :
351242 name : ' Ubuntu SSL tests with OpenSSL'
@@ -356,7 +247,7 @@ jobs:
356247 strategy :
357248 fail-fast : false
358249 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 ]
360251 env :
361252 OPENSSL_VER : ${{ matrix.openssl_ver }}
362253 MULTISSL_DIR : ${{ github.workspace }}/multissl
@@ -408,13 +299,13 @@ jobs:
408299 needs : check_source
409300 if : needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
410301 env :
411- OPENSSL_VER : 1.1.1v
302+ OPENSSL_VER : 3.0.11
412303 PYTHONSTRICTEXTENSIONBUILD : 1
413304 steps :
414305 - uses : actions/checkout@v4
415306 - name : Register gcc problem matcher
416307 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
417- - name : Install Dependencies
308+ - name : Install dependencies
418309 run : sudo ./.github/workflows/posix-deps-apt.sh
419310 - name : Configure OpenSSL env vars
420311 run : |
@@ -517,7 +408,7 @@ jobs:
517408 needs : check_source
518409 if : needs.check_source.outputs.run_tests == 'true'
519410 env :
520- OPENSSL_VER : 1.1.1v
411+ OPENSSL_VER : 3.0.11
521412 PYTHONSTRICTEXTENSIONBUILD : 1
522413 ASAN_OPTIONS : detect_leaks=0:allocator_may_return_null=1:handle_segv=0
523414 steps :
@@ -571,11 +462,10 @@ jobs:
571462 - check_source # Transitive dependency, needed to access `run_tests` value
572463 - check-docs
573464 - check_generated_files
574- - build_win32
575- - build_win_amd64
576465 - build_macos
577466 - build_ubuntu
578467 - build_ubuntu_ssltests
468+ - build_windows
579469 - test_hypothesis
580470 - build_asan
581471
@@ -588,7 +478,6 @@ jobs:
588478 allowed-failures : >-
589479 build_macos,
590480 build_ubuntu_ssltests,
591- build_win32,
592481 test_hypothesis,
593482 allowed-skips : >-
594483 ${{
@@ -602,11 +491,10 @@ jobs:
602491 needs.check_source.outputs.run_tests != 'true'
603492 && '
604493 check_generated_files,
605- build_win32,
606- build_win_amd64,
607494 build_macos,
608495 build_ubuntu,
609496 build_ubuntu_ssltests,
497+ build_windows,
610498 build_asan,
611499 '
612500 || ''
0 commit comments