Skip to content

Commit

Permalink
[CI] Ensure simulators are ready before running Xcode-related tasks (#…
Browse files Browse the repository at this point in the history
…602)

* Download platform in unit tests

* Disable other platforms in unit tests (tmp)

* Revert "Disable other platforms in unit tests (tmp)"

This reverts commit 82ddcf6.

* Do not run extra commands for macOS and catalyst

* Fix condition

* Add extra step to other actions

* Disable tvOS integration tests
  • Loading branch information
bamx23 authored Mar 2, 2025
1 parent 391495c commit 3d16519
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ jobs:
with:
xcode-version: latest-stable

- name: Ensure the Platform is Downloaded
if: ${{ matrix.platform != 'macOS' }}
run: |
xcodebuild -runFirstLaunch
xcrun simctl list
xcodebuild -downloadPlatform ${{ matrix.platform }}
xcodebuild -runFirstLaunch
- name: Install Tuist
run: |
brew tap tuist/tuist
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/cocoapods-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ jobs:
with:
xcode-version: latest-stable

- name: Ensure the Platform is Downloaded
if: ${{ matrix.platform != 'macOS' }}
run: |
xcodebuild -runFirstLaunch
xcrun simctl list
xcodebuild -downloadPlatform ${{ matrix.platform }}
xcodebuild -runFirstLaunch
- name: Lint Podspec
id: lint
run: |
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jobs:
# iOS integration tests are too flaky and are temporary excluded
# - platform: iOS
- platform: macOS
- platform: tvOS
# tvOS integration tests became flaky after Xcode 16.2
# - platform: tvOS
- platform: watchOS
steps:
- name: Checkout Code
Expand All @@ -39,6 +40,14 @@ jobs:
with:
xcode-version: latest-stable

- name: Ensure the Platform is Downloaded
if: ${{ matrix.platform != 'macOS' }}
run: |
xcodebuild -runFirstLaunch
xcrun simctl list
xcodebuild -downloadPlatform ${{ matrix.platform }}
xcodebuild -runFirstLaunch
- name: Install Tuist
run: |
brew tap tuist/tuist
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ jobs:
with:
xcode-version: latest-stable

- name: Install visionOS Platform
shell: bash
- name: Ensure Platforms are Downloaded
run: |
# See https://github.com/actions/runner-images/issues/10692#issuecomment-2377521050
xcodebuild -runFirstLaunch
xcrun simctl list
xcodebuild -downloadPlatform visionOS
xcodebuild -runFirstLaunch
for platform in iOS watchOS tvOS visionOS; do
echo "Downloading $platform platform..."
xcodebuild -downloadPlatform $platform
xcodebuild -runFirstLaunch
done
- name: Update version in podspec
run: sed -i '' 's/s.version = "[^"]*"/s.version = "${{ github.event.inputs.version }}"/' KSCrash.podspec
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ jobs:
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
Expand Down

0 comments on commit 3d16519

Please sign in to comment.