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
@@ -122,20 +120,22 @@ jobs:
122120
123121 check_generated_files :
124122 name : ' Check if generated files are up to date'
125- runs-on : ubuntu-latest
123+ # Don't use ubuntu-latest but a specific version to make the job
124+ # reproducible: to get the same tools versions (autoconf, aclocal, ...)
125+ runs-on : ubuntu-22.04
126126 timeout-minutes : 60
127127 needs : check_source
128128 if : needs.check_source.outputs.run_tests == 'true'
129129 steps :
130130 - uses : actions/checkout@v4
131+ - uses : actions/setup-python@v4
132+ with :
133+ python-version : ' 3.x'
131134 - name : Restore config.cache
132135 uses : actions/cache@v3
133136 with :
134137 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'
138+ key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
139139 - name : Install Dependencies
140140 run : sudo ./.github/workflows/posix-deps-apt.sh
141141 - name : Add ccache to PATH
@@ -145,15 +145,16 @@ jobs:
145145 - name : Check Autoconf and aclocal versions
146146 run : |
147147 grep "Generated by GNU Autoconf 2.71" configure
148- grep "aclocal 1.16.4 " aclocal.m4
148+ grep "aclocal 1.16.5 " aclocal.m4
149149 grep -q "runstatedir" configure
150150 grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
151151 - name : Configure CPython
152152 run : |
153153 # Build Python with the libpython dynamic library
154154 ./configure --config-cache --with-pydebug --enable-shared
155- - name : Regenerate autoconf files with container image
156- run : make regen-configure
155+ - name : Regenerate autoconf files
156+ # Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
157+ run : autoreconf -ivf -Werror
157158 - name : Build CPython
158159 run : |
159160 make -j4 regen-all
@@ -180,159 +181,63 @@ jobs:
180181 if : github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
181182 run : make check-c-globals
182183
183- build_win32 :
184- name : ' Windows (x86)'
185- runs-on : windows-latest
186- timeout-minutes : 60
184+ build_windows :
185+ name : ' Windows'
187186 needs : check_source
188187 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
188+ uses : ./.github/workflows/reusable-windows.yml
199189
200- build_win_amd64 :
201- name : ' Windows (x64)'
202- runs-on : windows-latest
203- timeout-minutes : 60
190+ build_windows_free_threaded :
191+ name : ' Windows (free-threaded)'
204192 needs : check_source
205193 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
194+ uses : ./.github/workflows/reusable-windows.yml
195+ with :
196+ free-threaded : true
218197
219- build_win_arm64 :
220- name : ' Windows (arm64)'
221- runs-on : windows-latest
222- timeout-minutes : 60
198+ build_macos :
199+ name : ' macOS'
223200 needs : check_source
224201 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
202+ uses : ./.github/workflows/reusable-macos.yml
203+ with :
204+ config_hash : ${{ needs.check_source.outputs.config_hash }}
233205
234- build_macos :
235- name : ' macOS'
236- runs-on : macos-latest
237- timeout-minutes : 60
206+ build_macos_free_threaded :
207+ name : ' macOS (free-threaded)'
238208 needs : check_source
239209 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 openssl@3.0 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 openssl@3.0)"
263- - name : Build CPython
264- run : make -j4
265- - name : Display build info
266- run : make pythoninfo
267- - name : Tests
268- run : make test
210+ uses : ./.github/workflows/reusable-macos.yml
211+ with :
212+ config_hash : ${{ needs.check_source.outputs.config_hash }}
213+ free-threaded : true
269214
270215 build_ubuntu :
271216 name : ' Ubuntu'
272- runs-on : ubuntu-20.04
273- timeout-minutes : 60
274217 needs : check_source
275218 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/ccache-action@v1.2
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 : |
219+ uses : ./.github/workflows/reusable-ubuntu.yml
220+ with :
221+ config_hash : ${{ needs.check_source.outputs.config_hash }}
222+ options : |
320223 ../cpython-ro-srcdir/configure \
321224 --config-cache \
322225 --with-pydebug \
323226 --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
227+
228+ build_ubuntu_free_threaded :
229+ name : ' Ubuntu (free-threaded)'
230+ needs : check_source
231+ if : needs.check_source.outputs.run_tests == 'true'
232+ uses : ./.github/workflows/reusable-ubuntu.yml
233+ with :
234+ config_hash : ${{ needs.check_source.outputs.config_hash }}
235+ options : |
236+ ../cpython-ro-srcdir/configure \
237+ --config-cache \
238+ --with-pydebug \
239+ --with-openssl=$OPENSSL_DIR \
240+ --disable-gil
336241
337242 build_ubuntu_ssltests :
338243 name : ' Ubuntu SSL tests with OpenSSL'
@@ -598,12 +503,13 @@ jobs:
598503 - check_source # Transitive dependency, needed to access `run_tests` value
599504 - check-docs
600505 - check_generated_files
601- - build_win32
602- - build_win_amd64
603- - build_win_arm64
604506 - build_macos
507+ - build_macos_free_threaded
605508 - build_ubuntu
509+ - build_ubuntu_free_threaded
606510 - build_ubuntu_ssltests
511+ - build_windows
512+ - build_windows_free_threaded
607513 - test_hypothesis
608514 - build_asan
609515 - cifuzz
@@ -615,10 +521,7 @@ jobs:
615521 uses : re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
616522 with :
617523 allowed-failures : >-
618- build_macos,
619524 build_ubuntu_ssltests,
620- build_win32,
621- build_win_arm64,
622525 cifuzz,
623526 test_hypothesis,
624527 allowed-skips : >-
@@ -633,12 +536,13 @@ jobs:
633536 needs.check_source.outputs.run_tests != 'true'
634537 && '
635538 check_generated_files,
636- build_win32,
637- build_win_amd64,
638- build_win_arm64,
639539 build_macos,
540+ build_macos_free_threaded,
640541 build_ubuntu,
542+ build_ubuntu_free_threaded,
641543 build_ubuntu_ssltests,
544+ build_windows,
545+ build_windows_free_threaded,
642546 build_asan,
643547 '
644548 || ''
0 commit comments