[CI] Ensure simulators are ready before running Xcode-related tasks #475
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
name: Run Unit Tests | |
on: | |
pull_request: | |
paths: | |
- "Sources/**" | |
- "Tests/**" | |
- "Package.swift" | |
- ".github/workflows/unit-tests.yml" | |
- ".swiftpm/xcode/xcshareddata/xcschemes/**" | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: "0 0 1 * *" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
unit-tests: | |
runs-on: "macos-${{ matrix.macos-version || 'latest' }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: iOS | |
macos-version: "15" | |
- platform: iOS | |
xcode-version: "latest" | |
macos-version: "15" | |
- platform: iOS | |
platform-version: ~16.4.0 | |
macos-version: "13" | |
xcode-version: "14.3.1" | |
- platform: watchOS | |
macos-version: "15" | |
- platform: watchOS | |
platform-version: ~9.4.0 | |
macos-version: "13" | |
xcode-version: "14.3.1" | |
- platform: tvOS | |
macos-version: "15" | |
- platform: tvOS | |
platform-version: ~16.4.0 | |
macos-version: "13" | |
xcode-version: "14.3.1" | |
- platform: visionOS | |
macos-version: "15" | |
- platform: macOS | |
- platform: macOS | |
macos-version: "13" | |
- platform: mac-catalyst | |
- platform: mac-catalyst | |
macos-version: "13" | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Use Latest Stable Xcode | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: ${{ matrix.xcode-version || 'latest-stable' }} | |
- name: Ensure the Platform is Downloaded | |
if: ${{ matrix.platform != 'macOS' && matrix.platform != 'mac-catalyst' }} | |
run: | | |
xcodebuild -runFirstLaunch | |
xcrun simctl list | |
xcodebuild -downloadPlatform ${{ matrix.platform }} | |
xcodebuild -runFirstLaunch | |
- name: Run Unit Tests | |
uses: mxcl/xcodebuild@v3 | |
timeout-minutes: 15 | |
with: | |
workspace: ".swiftpm/xcode/package.xcworkspace" | |
scheme: "KSCrash-Package" | |
platform: ${{ matrix.platform }} | |
platform-version: ${{ matrix.platform-version }} |