@@ -108,7 +108,7 @@ jobs:
108108 needs : check_source
109109 if : needs.check_source.outputs.run_tests == 'true'
110110 steps :
111- - uses : actions/checkout@v3
111+ - uses : actions/checkout@v4
112112 - uses : actions/setup-python@v4
113113 - name : Install dependencies
114114 run : |
@@ -208,159 +208,32 @@ jobs:
208208 if : github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
209209 run : make check-c-globals
210210
211- build_win32 :
212- name : ' Windows (x86)'
213- runs-on : windows-latest
214- timeout-minutes : 60
211+ build_windows :
212+ name : ' Windows'
215213 needs : check_source
216214 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
261216
262217 build_macos :
263218 name : ' macOS'
264- runs-on : macos-latest
265- timeout-minutes : 60
266219 needs : check_source
267220 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 }}
297224
298225 build_ubuntu :
299226 name : ' Ubuntu'
300- runs-on : ubuntu-20.04
301- timeout-minutes : 60
302227 needs : check_source
303228 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 : |
348233 ../cpython-ro-srcdir/configure \
349234 --config-cache \
350235 --with-pydebug \
351236 --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"
364237
365238 build_ubuntu_ssltests :
366239 name : ' Ubuntu SSL tests with OpenSSL'
@@ -429,7 +302,7 @@ jobs:
429302 - uses : actions/checkout@v4
430303 - name : Register gcc problem matcher
431304 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
432- - name : Install Dependencies
305+ - name : Install dependencies
433306 run : sudo ./.github/workflows/posix-deps-apt.sh
434307 - name : Configure OpenSSL env vars
435308 run : |
@@ -586,12 +459,10 @@ jobs:
586459 - check_source # Transitive dependency, needed to access `run_tests` value
587460 - check-docs
588461 - check_generated_files
589- - build_win32
590- - build_win_amd64
591- - build_win_arm64
592462 - build_macos
593463 - build_ubuntu
594464 - build_ubuntu_ssltests
465+ - build_windows
595466 - test_hypothesis
596467 - build_asan
597468
@@ -604,8 +475,6 @@ jobs:
604475 allowed-failures : >-
605476 build_macos,
606477 build_ubuntu_ssltests,
607- build_win32,
608- build_win_arm64,
609478 test_hypothesis,
610479 allowed-skips : >-
611480 ${{
@@ -619,12 +488,10 @@ jobs:
619488 needs.check_source.outputs.run_tests != 'true'
620489 && '
621490 check_generated_files,
622- build_win32,
623- build_win_amd64,
624- build_win_arm64,
625491 build_macos,
626492 build_ubuntu,
627493 build_ubuntu_ssltests,
494+ build_windows,
628495 build_asan,
629496 '
630497 || ''
0 commit comments