[iOS] Tweak Specialize Template Action #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build and Test the Xcode App | |
# This tests the `SwiftProjectTemplateAppPackage` as well as the `SwiftProjectTemplateApp` Xcode project. | |
name: Build and Test (Xcode) | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-test-xcode: | |
strategy: | |
matrix: | |
xcode-version: | |
- "16" | |
xcode-configuration: | |
- name: iOS Simulator | |
destination: "platform=iOS Simulator,name=iPhone 16" | |
sdk: "iphonesimulator" | |
- name: macOS | |
destination: "platform=macOS" | |
sdk: "macosx" | |
swift-configuration: | |
- "debug" | |
- "release" | |
runs-on: macos-15 | |
name: Build and Test (${{ matrix.xcode-configuration.name }}, ${{ matrix.swift-configuration }}) | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Select Xcode | |
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer | |
- name: Build | |
run: | | |
xcrun xcodebuild clean build \ | |
-workspace .xcode/SwiftProjectTemplate.xcworkspace \ | |
-scheme SwiftProjectTemplateApp \ | |
-derivedDataPath ".build/Xcode.noindex/DerivedData" \ | |
-configuration "${{ matrix.swift-configuration }}" \ | |
-sdk "${{ matrix.xcode-configuration.sdk }}" \ | |
-destination "${{ matrix.xcode-configuration.destination }}" | |
- name: SwiftPM Tests | |
if: matrix.swift-configuration == 'debug' | |
run: | | |
xcrun xcodebuild test \ | |
-workspace .xcode/SwiftProjectTemplate.xcworkspace \ | |
-scheme SwiftProjectTemplateAppPackage \ | |
-derivedDataPath ".build/Xcode.noindex/DerivedData" \ | |
-configuration "${{ matrix.swift-configuration }}" \ | |
-sdk "${{ matrix.xcode-configuration.sdk }}" \ | |
-destination "${{ matrix.xcode-configuration.destination }}" | |
- name: UI Tests | |
run: | | |
xcrun xcodebuild test \ | |
-workspace .xcode/SwiftProjectTemplate.xcworkspace \ | |
-scheme SwiftProjectTemplateAppUITests \ | |
-derivedDataPath ".build/Xcode.noindex/DerivedData" \ | |
-configuration "${{ matrix.swift-configuration }}" \ | |
-sdk "${{ matrix.xcode-configuration.sdk }}" \ | |
-destination "${{ matrix.xcode-configuration.destination }}" | |
- name: Upload Test Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Test Results (${{ matrix.xcode-configuration.name }}, ${{ matrix.swift-configuration }}) | |
path: .build/Xcode.noindex/DerivedData/Logs/Test | |
- name: Check that repository is clean | |
run: | |
git diff --exit-code |