@@ -156,20 +156,10 @@ jobs:
156156 python-version : ' 3.x'
157157 - name : Runner image version
158158 run : echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
159- - name : Restore config.cache
160- uses : actions/cache@v4
161- with :
162- path : config.cache
163- # Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
164- key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
165159 - name : Install dependencies
166160 run : sudo ./.github/workflows/posix-deps-apt.sh
167161 - name : Add ccache to PATH
168162 run : echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
169- - name : Configure ccache action
170- uses : hendrikmuhs/ccache-action@v1.2
171- with :
172- save : false
173163 - name : Configure CPython
174164 run : |
175165 # Build Python with the libpython dynamic library
@@ -249,28 +239,19 @@ jobs:
249239 strategy :
250240 fail-fast : false
251241 matrix :
252- # Cirrus and macos-14 are M1, macos-15-intel is default GHA Intel.
253- # macOS 13 only runs tests against the GIL-enabled CPython.
254- # Cirrus used for upstream, macos-14 for forks.
242+ # macos-14 is M1, macos-15-intel is Intel.
243+ # macos-15-intel only runs tests against the GIL-enabled CPython.
255244 os :
256- - ghcr.io/cirruslabs/macos-runner:sonoma
257245 - macos-14
258246 - macos-15-intel
259- is-fork : # only used for the exclusion trick
260- - ${{ github.repository_owner != 'python' }}
261247 free-threading :
262248 - false
263249 - true
264250 exclude :
265- - os : ghcr.io/cirruslabs/macos-runner:sonoma
266- is-fork : true
267- - os : macos-14
268- is-fork : false
269251 - os : macos-15-intel
270252 free-threading : true
271253 uses : ./.github/workflows/reusable-macos.yml
272254 with :
273- config_hash : ${{ needs.build-context.outputs.config-hash }}
274255 free-threading : ${{ matrix.free-threading }}
275256 os : ${{ matrix.os }}
276257
@@ -302,7 +283,6 @@ jobs:
302283 bolt : true
303284 uses : ./.github/workflows/reusable-ubuntu.yml
304285 with :
305- config_hash : ${{ needs.build-context.outputs.config-hash }}
306286 bolt-optimizations : ${{ matrix.bolt }}
307287 free-threading : ${{ matrix.free-threading }}
308288 os : ${{ matrix.os }}
@@ -333,11 +313,6 @@ jobs:
333313 persist-credentials : false
334314 - name : Runner image version
335315 run : echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
336- - name : Restore config.cache
337- uses : actions/cache@v4
338- with :
339- path : config.cache
340- key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
341316 - name : Register gcc problem matcher
342317 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
343318 - name : Install dependencies
@@ -359,10 +334,6 @@ jobs:
359334 - name : Add ccache to PATH
360335 run : |
361336 echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
362- - name : Configure ccache action
363- uses : hendrikmuhs/ccache-action@v1.2
364- with :
365- save : false
366337 - name : Configure CPython
367338 run : ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl="$OPENSSL_DIR"
368339 - name : Build CPython
@@ -381,9 +352,8 @@ jobs:
381352 fail-fast : false
382353 matrix :
383354 include :
384- # Use the same runs-on configuration as build-macos and build-ubuntu.
385355 - arch : aarch64
386- runs-on : ${{ github.repository_owner == 'python' && 'ghcr.io/cirruslabs/ macos-runner:sonoma' || 'macos-14' }}
356+ runs-on : macos-14
387357 - arch : x86_64
388358 runs-on : ubuntu-24.04
389359
@@ -395,13 +365,34 @@ jobs:
395365 - name : Build and test
396366 run : ./Android/android.py ci --fast-ci ${{ matrix.arch }}-linux-android
397367
368+ build-ios :
369+ name : iOS
370+ needs : build-context
371+ if : needs.build-context.outputs.run-tests == 'true'
372+ timeout-minutes : 60
373+ runs-on : macos-15
374+ steps :
375+ - uses : actions/checkout@v4
376+ with :
377+ persist-credentials : false
378+
379+ # GitHub recommends explicitly selecting the desired Xcode version:
380+ # https://github.com/actions/runner-images/issues/12541#issuecomment-3083850140
381+ # This became a necessity as a result of
382+ # https://github.com/actions/runner-images/issues/12541 and
383+ # https://github.com/actions/runner-images/issues/12751.
384+ - name : Select Xcode version
385+ run : |
386+ sudo xcode-select --switch /Applications/Xcode_16.4.app
387+
388+ - name : Build and test
389+ run : python3 Apple ci iOS --fast-ci --simulator 'iPhone 16e,OS=18.5'
390+
398391 build-wasi :
399392 name : ' WASI'
400393 needs : build-context
401394 if : needs.build-context.outputs.run-tests == 'true'
402395 uses : ./.github/workflows/reusable-wasi.yml
403- with :
404- config_hash : ${{ needs.build-context.outputs.config-hash }}
405396
406397 test-hypothesis :
407398 name : " Hypothesis tests on Ubuntu"
@@ -437,10 +428,6 @@ jobs:
437428 - name : Add ccache to PATH
438429 run : |
439430 echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
440- - name : Configure ccache action
441- uses : hendrikmuhs/ccache-action@v1.2
442- with :
443- save : false
444431 - name : Setup directory envs for out-of-tree builds
445432 run : |
446433 echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
@@ -451,11 +438,6 @@ jobs:
451438 run : sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
452439 - name : Runner image version
453440 run : echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
454- - name : Restore config.cache
455- uses : actions/cache@v4
456- with :
457- path : ${{ env.CPYTHON_BUILDDIR }}/config.cache
458- key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
459441 - name : Configure CPython out-of-tree
460442 working-directory : ${{ env.CPYTHON_BUILDDIR }}
461443 run : |
@@ -539,11 +521,6 @@ jobs:
539521 persist-credentials : false
540522 - name : Runner image version
541523 run : echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
542- - name : Restore config.cache
543- uses : actions/cache@v4
544- with :
545- path : config.cache
546- key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
547524 - name : Register gcc problem matcher
548525 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
549526 - name : Install dependencies
@@ -569,11 +546,6 @@ jobs:
569546 - name : Add ccache to PATH
570547 run : |
571548 echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
572- - name : Configure ccache action
573- uses : hendrikmuhs/ccache-action@v1.2
574- with :
575- save : ${{ github.event_name == 'push' }}
576- max-size : " 200M"
577549 - name : Configure CPython
578550 run : ./configure --config-cache --with-address-sanitizer --without-pymalloc
579551 - name : Build CPython
@@ -605,7 +577,6 @@ jobs:
605577 uses : ./.github/workflows/reusable-san.yml
606578 with :
607579 sanitizer : ${{ matrix.sanitizer }}
608- config_hash : ${{ needs.build-context.outputs.config-hash }}
609580 free-threading : ${{ matrix.free-threading }}
610581
611582 cross-build-linux :
@@ -620,11 +591,6 @@ jobs:
620591 persist-credentials : false
621592 - name : Runner image version
622593 run : echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV"
623- - name : Restore config.cache
624- uses : actions/cache@v4
625- with :
626- path : config.cache
627- key : ${{ github.job }}-${{ env.IMAGE_OS_VERSION }}-${{ needs.build-context.outputs.config-hash }}
628594 - name : Register gcc problem matcher
629595 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
630596 - name : Set build dir
@@ -703,6 +669,7 @@ jobs:
703669 - build-ubuntu
704670 - build-ubuntu-ssltests
705671 - build-android
672+ - build-ios
706673 - build-wasi
707674 - test-hypothesis
708675 - build-asan
@@ -737,6 +704,7 @@ jobs:
737704 build-ubuntu,
738705 build-ubuntu-ssltests,
739706 build-android,
707+ build-ios,
740708 build-wasi,
741709 test-hypothesis,
742710 build-asan,
0 commit comments