Skip to content

Update CI Xcode and macOS #1244

Update CI Xcode and macOS

Update CI Xcode and macOS #1244

Workflow file for this run

name: Swift CI
permissions:
contents: read
pull-requests: write
on:
push:
branches:
- main
pull_request:
env:
XCODE_VERSION: 26.3
TUIST_TEST_DEVICE: iPad (10th generation)
TUIST_TEST_PLATFORM: iOS
# NOTE: When modifying jobs, you'll likely need to update the required status checks in GitHub repo settings.
# At time of writing, this can be found via (requires admin access):
# Settings → Branches → Edit "main" rule → "Require status checks to pass before merging"
# E.g. if the sdk version in the matrix below was bumped from 18.1 to 18.5, you would add 'development-tests [iOS 18.5]' to the required status checks, and remove 'development-tests [iOS 18.1]'.
jobs:
development-tests:
runs-on: macos-26
name: "development-tests [iOS ${{ matrix.sdk }}]"
env:
TUIST_TEST_SCHEME: UnitTests
strategy:
fail-fast: false
matrix:
include:
- sdk: "16.4"
simctl_runtime: "com.apple.CoreSimulator.SimRuntime.iOS-16-4"
installation_required: true
- sdk: "17.5"
simctl_runtime: "com.apple.CoreSimulator.SimRuntime.iOS-17-5"
installation_required: true
- sdk: "26.2"
simctl_runtime: "com.apple.CoreSimulator.SimRuntime.iOS-26-2"
installation_required: false
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- name: Switch to Xcode ${{ env.XCODE_VERSION }}
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
- name: Install iOS ${{ matrix.sdk }}
if: ${{ matrix.installation_required }}
run: |
sudo xcodes runtimes install "iOS ${{ matrix.sdk }}"
xcrun simctl list
- name: Ensure sim exists
run: |
xcrun simctl create \
"${{ env.TUIST_TEST_DEVICE }}" \
"${{ env.TUIST_TEST_DEVICE }}" \
"${{ matrix.simctl_runtime }}"
- name: Install dependencies
run: tuist install --path Samples
- name: Run Tests
run: tuist test --path Samples ${{ matrix.scheme }} --os "${{ matrix.sdk }}"
snapshot-tests:
runs-on: macos-26
env:
TUIST_TEST_OS: 26.2
TUIST_TEST_SCHEME: SnapshotTests
name: "snapshot-tests [iOS ${{ matrix.sdk }}]"
strategy:
fail-fast: false # Don’t fail-fast so that we get all snapshot test changes
matrix:
include:
- sdk: "26.2"
simctl_runtime: "com.apple.CoreSimulator.SimRuntime.iOS-26-2"
installation_required: false
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- name: Switch Xcode
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
- name: Install iOS ${{ matrix.sdk }}
if: ${{ matrix.installation_required }}
run: |
sudo xcodes runtimes install "iOS ${{ matrix.sdk }}"
xcrun simctl list
- name: Ensure sim exists
run: |
xcrun simctl create \
"${{ env.TUIST_TEST_DEVICE }}" \
"${{ env.TUIST_TEST_DEVICE }}" \
"${{ matrix.simctl_runtime }}"
- name: Install dependencies
run: tuist install --path Samples
- name: Run Snapshot Tests
run: tuist test --path Samples
package-tests:
runs-on: macos-26
steps:
- uses: actions/checkout@v4
- name: Switch Xcode
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
- name: Clear cache
run: swift package clean
- name: Build
run: swift build --triple arm64-darwin-macosx --build-tests
# Command line swift runs on the host platform.
# On macOS we can run macro tests.
- name: Test macOS
run: swift test
tutorial:
runs-on: macos-26
env:
TUIST_TEST_DEVICE: iPad Air 11-inch (M3)
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- name: Switch Xcode
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
- name: Install dependencies
run: tuist install --path Samples/Tutorial
- name: Tutorial App
run: tuist test --path Samples/Tutorial TutorialTests
swiftformat:
runs-on: macos-26
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- name: Run swiftformat
run: swiftformat --lint .