Skip to content

Commit 784dec0

Browse files
authored
CI: drop fastlane, reimplement create_simulators as script (#494)
1 parent be44e32 commit 784dec0

File tree

4 files changed

+225
-177
lines changed

4 files changed

+225
-177
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ jobs:
9393
9494
if [ "$PLATFORM" = "iPadOS" ]; then
9595
PLATFORM=iOS
96-
FASTLANE_PLATFORM=ipados
96+
SCRIPT_PLATFORM=ipados
9797
else
9898
case "$PLATFORM" in
99-
iOS) FASTLANE_PLATFORM=ios ;;
100-
tvOS) FASTLANE_PLATFORM=tvos ;;
101-
watchOS) FASTLANE_PLATFORM=watchos ;;
102-
visionOS) FASTLANE_PLATFORM=visionos ;;
103-
macOS) FASTLANE_PLATFORM=macos ;;
99+
iOS) SCRIPT_PLATFORM=ios ;;
100+
tvOS) SCRIPT_PLATFORM=tvos ;;
101+
watchOS) SCRIPT_PLATFORM=watchos ;;
102+
visionOS) SCRIPT_PLATFORM=visionos ;;
103+
macOS) SCRIPT_PLATFORM=macos ;;
104104
esac
105105
fi
106106
@@ -110,7 +110,7 @@ jobs:
110110
echo "MAJOR=$MAJOR" >> $GITHUB_ENV
111111
echo "MINOR=$MINOR" >> $GITHUB_ENV
112112
echo "RUNTIME=$RUNTIME" >> $GITHUB_ENV
113-
echo "FASTLANE_PLATFORM=$FASTLANE_PLATFORM" >> $GITHUB_ENV
113+
echo "SCRIPT_PLATFORM=$SCRIPT_PLATFORM" >> $GITHUB_ENV
114114
115115
- if: ${{ env.PLATFORM != 'macOS' }}
116116
name: Check for ${{ env.RUNTIME }} runtime
@@ -128,20 +128,12 @@ jobs:
128128
action: none
129129
verbosity: xcbeautify
130130

131-
- if: ${{ env.PLATFORM != 'macOS' }}
132-
name: Download Required Runtime
133-
uses: nick-fields/retry@v3
134-
with:
135-
timeout_minutes: 15
136-
max_attempts: 3
137-
command: xcodebuild -downloadPlatform ${{ env.PLATFORM }}
138-
139131
- if: env.has_runtime == 'false'
140132
name: List Downloadable Runtimes
141133
run: xcodes runtimes --include-betas
142134

143135
- if: env.has_runtime == 'false'
144-
name: Install Required Runtime (${{ env.RUNTIME }})
136+
name: Download Required Runtime (${{ env.RUNTIME }})
145137
uses: nick-fields/retry@v3
146138
with:
147139
timeout_minutes: 15
@@ -153,7 +145,12 @@ jobs:
153145
run: |
154146
set -eo pipefail
155147
xcrun simctl delete all
156-
fastlane create_simulators platform:${{ env.FASTLANE_PLATFORM }} version:${{ env.MAJOR }}
148+
OUTPUT=$(script/create_simulators --platform ${{ env.SCRIPT_PLATFORM }} --version ${{ env.MAJOR }} | tee /dev/stderr)
149+
FIRST_UDID=$(printf "%s\n" "$OUTPUT" | awk '/^(Created:|Already exists:)/{print $NF}' | head -n1)
150+
if [ -n "$FIRST_UDID" ]; then
151+
echo "SIM_UDID=$FIRST_UDID" >> "$GITHUB_ENV"
152+
echo "Captured SIM_UDID=$FIRST_UDID"
153+
fi
157154
158155
- name: List Available Runtimes, Simulators, and Destinations
159156
run: |
@@ -162,35 +159,38 @@ jobs:
162159
163160
- if: ${{ env.PLATFORM != 'watchOS' }}
164161
name: Build Showcase
165-
uses: mxcl/xcodebuild@v3
162+
uses: davdroman/xcodebuild@destination
166163
with:
167164
xcode: ~26.0
168165
platform: ${{ env.PLATFORM }}
169166
platform-version: ~${{ env.MAJOR }}.${{ env.MINOR }}
167+
destination: ${{ env.SIM_UDID }}
170168
action: build
171169
scheme: Showcase
172170
configuration: Debug
173171
verbosity: xcbeautify
174172

175173
- if: ${{ env.PLATFORM == 'watchOS' }}
176174
name: Build Library
177-
uses: mxcl/xcodebuild@v3
175+
uses: davdroman/xcodebuild@destination
178176
with:
179177
xcode: ~26.0
180178
platform: ${{ env.PLATFORM }}
181179
platform-version: ~${{ env.MAJOR }}.${{ env.MINOR }}
180+
destination: ${{ env.SIM_UDID }}
182181
action: build
183182
scheme: SwiftUIIntrospect
184183
configuration: Debug
185184
verbosity: xcbeautify
186185

187186
- if: ${{ env.PLATFORM != 'watchOS' }}
188187
name: Run Tests
189-
uses: mxcl/xcodebuild@v3
188+
uses: davdroman/xcodebuild@destination
190189
with:
191190
xcode: ~26.0
192191
platform: ${{ env.PLATFORM }}
193192
platform-version: ~${{ env.MAJOR }}.${{ env.MINOR }}
193+
destination: ${{ env.SIM_UDID }}
194194
action: test
195195
scheme: SwiftUIIntrospectTests
196196
configuration: Debug

Tests/Tests/WeakTests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,49 @@ struct WeakTests {
77

88
var strongFoo: Foo? = Foo()
99

10-
@Test func Init_nil() {
10+
@Test func init_nil() {
1111
@Weak var weakFoo: Foo?
1212
#expect(weakFoo == nil)
1313
}
1414

15-
@Test func Init_nonNil() {
15+
@Test func init_nonNil() {
1616
@Weak var weakFoo: Foo? = strongFoo
1717
#expect(weakFoo === strongFoo)
1818
}
1919

20-
@Test func Assignment_nilToNil() {
20+
@Test func assignment_nilToNil() {
2121
@Weak var weakFoo: Foo?
2222
weakFoo = nil
2323
#expect(weakFoo == nil)
2424
}
2525

26-
@Test func Assignment_nilToNonNil() {
26+
@Test func assignment_nilToNonNil() {
2727
@Weak var weakFoo: Foo?
2828
let otherFoo = Foo()
2929
weakFoo = otherFoo
3030
#expect(weakFoo === otherFoo)
3131
}
3232

33-
@Test func Assignment_nonNilToNil() {
33+
@Test func assignment_nonNilToNil() {
3434
@Weak var weakFoo: Foo? = strongFoo
3535
weakFoo = nil
3636
#expect(weakFoo == nil)
3737
}
3838

39-
@Test func Assignment_nonNilToNonNil() {
39+
@Test func assignment_nonNilToNonNil() {
4040
@Weak var weakFoo: Foo? = strongFoo
4141
let otherFoo = Foo()
4242
weakFoo = otherFoo
4343
#expect(weakFoo === otherFoo)
4444
}
4545

46-
@Test mutating func IndirectAssignment_nonNilToNil() {
46+
@Test mutating func indirectAssignment_nonNilToNil() {
4747
@Weak var weakFoo: Foo? = strongFoo
4848
strongFoo = nil
4949
#expect(weakFoo == nil)
5050
}
5151

52-
@Test mutating func IndirectAssignment_nonNilToNonNil() {
52+
@Test mutating func indirectAssignment_nonNilToNonNil() {
5353
@Weak var weakFoo: Foo? = strongFoo
5454
strongFoo = Foo()
5555
#expect(weakFoo == nil)

fastlane/Fastfile

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)