2323permissions :
2424 contents : read
2525
26+ env :
27+ XCODE_VERSION : latest-stable
28+ IOS_SIMULATOR_DEVICE : iPhone 17 Pro
29+
2630jobs :
2731 format-check :
2832 name : Swift Format Check
3741 - name : Check Swift formatting
3842 run : bash lint-swift.sh
3943
40- # Package Unit Tests (standalone, no emulator needed )
44+ # Package Unit Tests (simulator-backed )
4145 unit-tests :
4246 name : Package Unit Tests
4347 runs-on : macos-26
@@ -48,22 +52,20 @@ jobs:
4852 - name : Install xcpretty
4953 run : gem install xcpretty
5054
51- - uses : maxim-lobanov/setup-xcode@v1
55+ - uses : maxim-lobanov/setup-xcode@9a237eadec58c1a4e3c19e27a1f6e2a3dce0a919
5256 with :
53- xcode-version : latest-stable
54- - name : Workaround Simulator Availability issues
55- run : |
56- # Just listing the installed simulators fixes availability inconsistency
57- # Without this, runs fail *intermittently* with build target not available because simulators not available
58- # See https://github.com/actions/runner-images/issues/13459#issuecomment-3681674842
59- xcrun simctl list
57+ xcode-version : ${{ env.XCODE_VERSION }}
58+
59+ - name : Prepare iOS Simulator
60+ id : prepare-simulator
61+ run : ./.github/workflows/scripts/prepare-ios-simulator.sh
6062
6163 - name : Run FirebaseSwiftUI Package Unit Tests
6264 run : |
6365 set -o pipefail
6466 xcodebuild test \
6567 -scheme FirebaseUI-Package \
66- -destination 'platform=iOS Simulator,OS=26.4,name=iPhone 17 Pro' \
68+ -destination "id=${{ steps.prepare-simulator.outputs.udid }}" \
6769 -enableCodeCoverage YES \
6870 -resultBundlePath FirebaseSwiftUIPackageTests.xcresult | tee FirebaseSwiftUIPackageTests.log | xcpretty --test --color --simple
6971
@@ -111,24 +113,21 @@ jobs:
111113 - name : Install xcpretty
112114 run : gem install xcpretty
113115
114- - uses : maxim-lobanov/setup-xcode@v1
116+ - uses : maxim-lobanov/setup-xcode@9a237eadec58c1a4e3c19e27a1f6e2a3dce0a919
115117 with :
116- xcode-version : latest-stable
118+ xcode-version : ${{ env.XCODE_VERSION }}
117119
118- - name : Workaround Simulator Availability issues
119- run : |
120- # Just listing the installed simulators fixes availability inconsistency
121- # Without this, runs fail *intermittently* with build target not available because simulators not available
122- # See https://github.com/actions/runner-images/issues/13459#issuecomment-3681674842
123- xcrun simctl list
120+ - name : Prepare iOS Simulator
121+ id : prepare-simulator
122+ run : ./.github/workflows/scripts/prepare-ios-simulator.sh
124123
125124 - name : Build for Integration Tests
126125 run : |
127126 cd ./e2eTest/FirebaseSwiftUIExample
128127 set -o pipefail
129128 xcodebuild build-for-testing \
130129 -scheme FirebaseSwiftUIExampleTests \
131- -destination 'platform=iOS Simulator,OS=26.4,name=iPhone 17 Pro' \
130+ -destination "id=${{ steps.prepare-simulator.outputs.udid }}" \
132131 -enableCodeCoverage YES | xcpretty --color --simple
133132
134133 - name : Run Integration Tests
@@ -137,7 +136,8 @@ jobs:
137136 set -o pipefail
138137 xcodebuild test-without-building \
139138 -scheme FirebaseSwiftUIExampleTests \
140- -destination 'platform=iOS Simulator,OS=26.4,name=iPhone 17 Pro' \
139+ -destination "id=${{ steps.prepare-simulator.outputs.udid }}" \
140+ -parallel-testing-enabled NO \
141141 -enableCodeCoverage YES \
142142 -resultBundlePath FirebaseSwiftUIExampleTests.xcresult | tee FirebaseSwiftUIExampleTests.log | xcpretty --test --color --simple
143143
@@ -185,24 +185,21 @@ jobs:
185185 - name : Install xcpretty
186186 run : gem install xcpretty
187187
188- - uses : maxim-lobanov/setup-xcode@v1
188+ - uses : maxim-lobanov/setup-xcode@9a237eadec58c1a4e3c19e27a1f6e2a3dce0a919
189189 with :
190- xcode-version : latest-stable
190+ xcode-version : ${{ env.XCODE_VERSION }}
191191
192- - name : Workaround Simulator Availability issues
193- run : |
194- # Just listing the installed simulators fixes availability inconsistency
195- # Without this, runs fail *intermittently* with build target not available because simulators not available
196- # See https://github.com/actions/runner-images/issues/13459#issuecomment-3681674842
197- xcrun simctl list
192+ - name : Prepare iOS Simulator
193+ id : prepare-simulator
194+ run : ./.github/workflows/scripts/prepare-ios-simulator.sh
198195
199196 - name : Build for UI Tests
200197 run : |
201198 cd ./e2eTest/FirebaseSwiftUIExample
202199 set -o pipefail
203200 xcodebuild build-for-testing \
204201 -scheme FirebaseSwiftUIExampleUITests \
205- -destination 'platform=iOS Simulator,OS=26.4,name=iPhone 17 Pro' \
202+ -destination "id=${{ steps.prepare-simulator.outputs.udid }}" \
206203 -enableCodeCoverage YES | xcpretty --color --simple
207204
208205 - name : Run UI Tests
@@ -211,7 +208,7 @@ jobs:
211208 set -o pipefail
212209 xcodebuild test-without-building \
213210 -scheme FirebaseSwiftUIExampleUITests \
214- -destination 'platform=iOS Simulator,OS=26.4,name=iPhone 17 Pro' \
211+ -destination "id=${{ steps.prepare-simulator.outputs.udid }}" \
215212 -parallel-testing-enabled NO \
216213 -enableCodeCoverage YES \
217214 -resultBundlePath FirebaseSwiftUIExampleUITests.xcresult | tee FirebaseSwiftUIExampleUITests.log | xcpretty --test --color --simple
0 commit comments