Skip to content

Commit 1488a8c

Browse files
committed
fix: another swift attempt at ci
I can't even test this locally, so this is guess and check
1 parent 1840860 commit 1488a8c

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

.github/workflows/ci-swift.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,29 @@ jobs:
8383
- name: Select Xcode 16.3
8484
run: sudo xcode-select -s /Applications/Xcode_16.3.app
8585

86+
- name: Create and Select Simulator
87+
run: |
88+
# List available runtimes
89+
echo "Available runtimes:"
90+
xcrun simctl list runtimes
91+
92+
# Get the latest iOS runtime
93+
IOS_RUNTIME=$(xcrun simctl list runtimes | grep "iOS" | tail -1 | sed -E 's/.*\(([0-9]+\.[0-9]+).*\).*(com\.apple\.CoreSimulator\.SimRuntime\.[^)]+).*/\2/')
94+
echo "Using iOS runtime: $IOS_RUNTIME"
95+
96+
# Create a new iPhone simulator
97+
UDID=$(xcrun simctl create "iPhone-CI" "iPhone 15" "$IOS_RUNTIME")
98+
echo "Created simulator with UDID: $UDID"
99+
100+
# Boot the simulator
101+
xcrun simctl boot "$UDID"
102+
echo "Booted simulator"
103+
104+
# Wait for simulator to be ready
105+
sleep 5
106+
107+
echo "SIMULATOR_UDID=$UDID" >> $GITHUB_ENV
108+
86109
- name: Install swiftformat
87110
run: brew install swiftformat
88111

@@ -96,7 +119,7 @@ jobs:
96119
-configuration debug \
97120
-workspace .github/zksyncsso.xcworkspace \
98121
-scheme zksyncsso \
99-
-destination "platform=iOS Simulator,name=Any iOS Simulator Device" || exit 1
122+
-destination "platform=iOS Simulator,id=${{ env.SIMULATOR_UDID }}" || exit 1
100123
101124
- name: Run Swift Integration Tests
102125
run: |
@@ -105,4 +128,4 @@ jobs:
105128
-configuration debug \
106129
-workspace .github/zksyncssointegration.xcworkspace \
107130
-scheme zksyncssointegration \
108-
-destination "platform=iOS Simulator,name=Any iOS Simulator Device" || exit 1
131+
-destination "platform=iOS Simulator,id=${{ env.SIMULATOR_UDID }}" || exit 1

0 commit comments

Comments
 (0)