@@ -109,20 +109,10 @@ jobs:
109109 python-version : ' 3.x'
110110 - name : Runner image version
111111 run : echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
112- - name : Restore config.cache
113- uses : actions/cache@v4
114- with :
115- path : config.cache
116- # Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
117- key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
118112 - name : Install dependencies
119113 run : sudo ./.github/workflows/posix-deps-apt.sh
120114 - name : Add ccache to PATH
121115 run : echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
122- - name : Configure ccache action
123- uses : hendrikmuhs/ccache-action@v1.2
124- with :
125- save : false
126116 - name : Configure CPython
127117 run : |
128118 # Build Python with the libpython dynamic library
@@ -202,28 +192,19 @@ jobs:
202192 strategy :
203193 fail-fast : false
204194 matrix :
205- # Cirrus and macos-14 are M1, macos-15-intel is default GHA Intel.
206- # macOS 13 only runs tests against the GIL-enabled CPython.
207- # Cirrus used for upstream, macos-14 for forks.
195+ # macos-14 is M1, macos-15-intel is Intel.
196+ # macos-15-intel only runs tests against the GIL-enabled CPython.
208197 os :
209- - ghcr.io/cirruslabs/macos-runner:sonoma
210198 - macos-14
211199 - macos-15-intel
212- is-fork : # only used for the exclusion trick
213- - ${{ github.repository_owner != 'python' }}
214200 free-threading :
215201 - false
216202 - true
217203 exclude :
218- - os : ghcr.io/cirruslabs/macos-runner:sonoma
219- is-fork : true
220- - os : macos-14
221- is-fork : false
222204 - os : macos-15-intel
223205 free-threading : true
224206 uses : ./.github/workflows/reusable-macos.yml
225207 with :
226- config_hash : ${{ needs.build-context.outputs.config-hash }}
227208 free-threading : ${{ matrix.free-threading }}
228209 os : ${{ matrix.os }}
229210
@@ -255,7 +236,6 @@ jobs:
255236 bolt : true
256237 uses : ./.github/workflows/reusable-ubuntu.yml
257238 with :
258- config_hash : ${{ needs.build-context.outputs.config-hash }}
259239 bolt-optimizations : ${{ matrix.bolt }}
260240 free-threading : ${{ matrix.free-threading }}
261241 os : ${{ matrix.os }}
@@ -286,11 +266,6 @@ jobs:
286266 persist-credentials : false
287267 - name : Runner image version
288268 run : echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
289- - name : Restore config.cache
290- uses : actions/cache@v4
291- with :
292- path : config.cache
293- key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
294269 - name : Register gcc problem matcher
295270 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
296271 - name : Install dependencies
@@ -312,10 +287,6 @@ jobs:
312287 - name : Add ccache to PATH
313288 run : |
314289 echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
315- - name : Configure ccache action
316- uses : hendrikmuhs/ccache-action@v1.2
317- with :
318- save : false
319290 - name : Configure CPython
320291 run : ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl="$OPENSSL_DIR"
321292 - name : Build CPython
@@ -347,11 +318,6 @@ jobs:
347318 persist-credentials : false
348319 - name : Runner image version
349320 run : echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
350- - name : Restore config.cache
351- uses : actions/cache@v4
352- with :
353- path : config.cache
354- key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
355321 - name : Register gcc problem matcher
356322 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
357323 - name : Install dependencies
@@ -378,10 +344,6 @@ jobs:
378344 - name : Add ccache to PATH
379345 run : |
380346 echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
381- - name : Configure ccache action
382- uses : hendrikmuhs/ccache-action@v1.2
383- with :
384- save : false
385347 - name : Configure CPython
386348 run : |
387349 ./configure CFLAGS="-fdiagnostics-format=json" \
@@ -409,9 +371,8 @@ jobs:
409371 fail-fast : false
410372 matrix :
411373 include :
412- # Use the same runs-on configuration as build-macos and build-ubuntu.
413374 - arch : aarch64
414- runs-on : ${{ github.repository_owner == 'python' && 'ghcr.io/cirruslabs/ macos-runner:sonoma' || 'macos-14' }}
375+ runs-on : macos-14
415376 - arch : x86_64
416377 runs-on : ubuntu-24.04
417378
@@ -423,13 +384,34 @@ jobs:
423384 - name : Build and test
424385 run : ./Android/android.py ci --fast-ci ${{ matrix.arch }}-linux-android
425386
387+ build-ios :
388+ name : iOS
389+ needs : build-context
390+ if : needs.build-context.outputs.run-tests == 'true'
391+ timeout-minutes : 60
392+ runs-on : macos-15
393+ steps :
394+ - uses : actions/checkout@v4
395+ with :
396+ persist-credentials : false
397+
398+ # GitHub recommends explicitly selecting the desired Xcode version:
399+ # https://github.com/actions/runner-images/issues/12541#issuecomment-3083850140
400+ # This became a necessity as a result of
401+ # https://github.com/actions/runner-images/issues/12541 and
402+ # https://github.com/actions/runner-images/issues/12751.
403+ - name : Select Xcode version
404+ run : |
405+ sudo xcode-select --switch /Applications/Xcode_16.4.app
406+
407+ - name : Build and test
408+ run : python3 Apple ci iOS --fast-ci --simulator 'iPhone 16e,OS=18.5'
409+
426410 build-wasi :
427411 name : ' WASI'
428412 needs : build-context
429413 if : needs.build-context.outputs.run-tests == 'true'
430414 uses : ./.github/workflows/reusable-wasi.yml
431- with :
432- config_hash : ${{ needs.build-context.outputs.config-hash }}
433415
434416 test-hypothesis :
435417 name : " Hypothesis tests on Ubuntu"
@@ -465,10 +447,6 @@ jobs:
465447 - name : Add ccache to PATH
466448 run : |
467449 echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
468- - name : Configure ccache action
469- uses : hendrikmuhs/ccache-action@v1.2
470- with :
471- save : false
472450 - name : Setup directory envs for out-of-tree builds
473451 run : |
474452 echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
@@ -479,11 +457,6 @@ jobs:
479457 run : sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
480458 - name : Runner image version
481459 run : echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
482- - name : Restore config.cache
483- uses : actions/cache@v4
484- with :
485- path : ${{ env.CPYTHON_BUILDDIR }}/config.cache
486- key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
487460 - name : Configure CPython out-of-tree
488461 working-directory : ${{ env.CPYTHON_BUILDDIR }}
489462 run : |
@@ -567,11 +540,6 @@ jobs:
567540 persist-credentials : false
568541 - name : Runner image version
569542 run : echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
570- - name : Restore config.cache
571- uses : actions/cache@v4
572- with :
573- path : config.cache
574- key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
575543 - name : Register gcc problem matcher
576544 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
577545 - name : Install dependencies
@@ -597,11 +565,6 @@ jobs:
597565 - name : Add ccache to PATH
598566 run : |
599567 echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
600- - name : Configure ccache action
601- uses : hendrikmuhs/ccache-action@v1.2
602- with :
603- save : ${{ github.event_name == 'push' }}
604- max-size : " 200M"
605568 - name : Configure CPython
606569 run : ./configure --config-cache --with-address-sanitizer --without-pymalloc
607570 - name : Build CPython
@@ -633,7 +596,6 @@ jobs:
633596 uses : ./.github/workflows/reusable-san.yml
634597 with :
635598 sanitizer : ${{ matrix.sanitizer }}
636- config_hash : ${{ needs.build-context.outputs.config-hash }}
637599 free-threading : ${{ matrix.free-threading }}
638600
639601 cross-build-linux :
@@ -648,11 +610,6 @@ jobs:
648610 persist-credentials : false
649611 - name : Runner image version
650612 run : echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
651- - name : Restore config.cache
652- uses : actions/cache@v4
653- with :
654- path : config.cache
655- key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
656613 - name : Register gcc problem matcher
657614 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
658615 - name : Set build dir
@@ -732,6 +689,7 @@ jobs:
732689 - build-ubuntu-ssltests-awslc
733690 - build-ubuntu-ssltests-openssl
734691 - build-android
692+ - build-ios
735693 - build-wasi
736694 - test-hypothesis
737695 - build-asan
@@ -768,6 +726,7 @@ jobs:
768726 build-ubuntu-ssltests-awslc,
769727 build-ubuntu-ssltests-openssl,
770728 build-android,
729+ build-ios,
771730 build-wasi,
772731 test-hypothesis,
773732 build-asan,
0 commit comments