Skip to content

Commit 7f8eb68

Browse files
committed
WIP
1 parent e144cb3 commit 7f8eb68

File tree

1 file changed

+78
-64
lines changed

1 file changed

+78
-64
lines changed

.github/workflows/ci.yml

Lines changed: 78 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -43,64 +43,78 @@ jobs:
4343
4444
ci:
4545
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.title, '[skip ci]')
46-
name: ${{ matrix.platform[0] }} ${{ matrix.platform[1] }}
46+
name: ${{ matrix.runtime[0] }} ${{ matrix.runtime[1] }}
4747
runs-on: macos-15
4848
strategy:
4949
fail-fast: false
5050
matrix:
51-
include:
52-
- platform: [iOS, 15]
53-
runtime: iOS 15.5
54-
- platform: [iOS, 16]
55-
runtime: iOS 16.4
56-
- platform: [iOS, 17]
57-
runtime: iOS 17.5
58-
- platform: [iOS, 18]
59-
runtime: iOS 18.6
60-
- platform: [iOS, 26]
61-
runtime: iOS 26.0
62-
63-
- platform: [tvOS, 15]
64-
runtime: tvOS 15.4
65-
- platform: [tvOS, 16]
66-
runtime: tvOS 16.4
67-
- platform: [tvOS, 17]
68-
runtime: tvOS 17.5
69-
- platform: [tvOS, 18]
70-
runtime: tvOS 18.5
71-
- platform: [tvOS, 26]
72-
runtime: tvOS 26.0
73-
74-
- platform: [watchOS, 8]
75-
runtime: watchOS 8.5
76-
- platform: [watchOS, 9]
77-
runtime: watchOS 9.4
78-
- platform: [watchOS, 10]
79-
runtime: watchOS 10.5
80-
- platform: [watchOS, 11]
81-
runtime: watchOS 11.5
82-
- platform: [watchOS, 26]
83-
runtime: watchOS 26.0
84-
85-
- platform: [macOS, 15]
86-
runtime: macOS 15
87-
# - platform: [macOS, 26]
88-
# runtime: macOS 26.0
89-
90-
- platform: [visionOS, 1]
91-
runtime: visionOS 1.2
92-
- platform: [visionOS, 2]
93-
runtime: visionOS 2.5
94-
- platform: [visionOS, 26]
95-
runtime: visionOS 26.0
51+
runtime:
52+
- [iOS, 15, 5]
53+
- [iOS, 16, 4]
54+
- [iOS, 17, 5]
55+
- [iOS, 18, 6]
56+
- [iOS, 26, 0]
57+
58+
- [iPadOS, 15, 5]
59+
- [iPadOS, 16, 4]
60+
- [iPadOS, 17, 5]
61+
- [iPadOS, 18, 6]
62+
- [iPadOS, 26, 0]
63+
64+
- [tvOS, 15, 4]
65+
- [tvOS, 16, 4]
66+
- [tvOS, 17, 5]
67+
- [tvOS, 18, 5]
68+
- [tvOS, 26, 0]
69+
70+
- [watchOS, 8, 5]
71+
- [watchOS, 9, 4]
72+
- [watchOS, 10, 5]
73+
- [watchOS, 11, 5]
74+
- [watchOS, 26, 0]
75+
76+
- [macOS, 15, 0]
77+
# - [macOS, 26, 0]
78+
79+
- [visionOS, 1, 2]
80+
- [visionOS, 2, 5]
81+
- [visionOS, 26, 0]
9682
steps:
9783
- name: Git Checkout
9884
uses: actions/checkout@v5
9985

100-
- if: ${{ matrix.platform[0] != 'macOS' }}
101-
name: Check for ${{ matrix.runtime }} runtime
86+
- name: Set Environment Variables
87+
run: |
88+
set -euo pipefail
89+
90+
RUNTIME="$PLATFORM $MAJOR.$MINOR"
91+
PLATFORM="${{ matrix.runtime[0] }}"
92+
MAJOR="${{ matrix.runtime[1] }}"
93+
MINOR="${{ matrix.runtime[2] }}"
94+
95+
if [ "$PLATFORM" = "iPadOS" ]; then
96+
PLATFORM=iOS
97+
FASTLANE_PLATFORM=ipados
98+
else
99+
case "$PLATFORM" in
100+
iOS) FASTLANE_PLATFORM=ios ;;
101+
tvOS) FASTLANE_PLATFORM=tvos ;;
102+
watchOS) FASTLANE_PLATFORM=watchos ;;
103+
visionOS) FASTLANE_PLATFORM=visionos ;;
104+
macOS) FASTLANE_PLATFORM=macos ;;
105+
esac
106+
fi
107+
108+
echo "RUNTIME=$RUNTIME" >> $GITHUB_ENV
109+
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV
110+
echo "MAJOR=$MAJOR" >> $GITHUB_ENV
111+
echo "MINOR=$MINOR" >> $GITHUB_ENV
112+
echo "FASTLANE_PLATFORM=$FASTLANE_PLATFORM" >> $GITHUB_ENV
113+
114+
- if: ${{ env.PLATFORM != 'macOS' }}
115+
name: Check for ${{ env.RUNTIME }} runtime
102116
run: |
103-
if xcrun simctl list runtimes | grep -q "${{ matrix.runtime }}"; then
117+
if xcrun simctl list runtimes | grep -q "$RUNTIME"; then
104118
echo "has_runtime=true" >> "$GITHUB_ENV"
105119
else
106120
echo "has_runtime=false" >> "$GITHUB_ENV"
@@ -113,69 +127,69 @@ jobs:
113127
action: none
114128
verbosity: xcbeautify
115129

116-
- if: ${{ matrix.platform[0] != 'macOS' }}
130+
- if: ${{ env.PLATFORM != 'macOS' }}
117131
name: Download Required Runtime
118132
uses: nick-fields/retry@v3
119133
with:
120134
timeout_minutes: 15
121135
max_attempts: 3
122-
command: xcodebuild -downloadPlatform ${{ matrix.platform[0] }}
136+
command: xcodebuild -downloadPlatform ${{ env.PLATFORM }}
123137

124138
- if: env.has_runtime == 'false'
125139
name: List Downloadable Runtimes
126140
run: xcodes runtimes --include-betas
127141

128142
- if: env.has_runtime == 'false'
129-
name: Install Required Runtime (${{ matrix.runtime }})
143+
name: Install Required Runtime (${{ env.RUNTIME }})
130144
uses: nick-fields/retry@v3
131145
with:
132146
timeout_minutes: 15
133147
max_attempts: 3
134-
command: sudo xcodes runtimes install '${{ matrix.runtime }}'
148+
command: sudo xcodes runtimes install "$RUNTIME"
135149

136-
- if: ${{ matrix.platform[0] != 'macOS' }}
150+
- if: ${{ env.PLATFORM != 'macOS' }}
137151
name: Create Required Simulators
138152
run: |
139153
set -eo pipefail
140154
xcrun simctl delete all
141-
fastlane create_simulators platform:${{ matrix.platform[0] }} version:${{ matrix.platform[1] }}
155+
fastlane create_simulators platform:${{ env.FASTLANE_PLATFORM }} version:${{ env.MAJOR }}
142156
143157
- name: List Available Runtimes, Simulators, and Destinations
144158
run: |
145159
xcrun simctl list
146160
xcodebuild -scheme "SwiftUIIntrospect" -showdestinations
147161
148-
- if: ${{ matrix.platform[0] != 'watchOS' }}
162+
- if: ${{ env.PLATFORM != 'watchOS' }}
149163
name: Build Showcase
150164
uses: mxcl/xcodebuild@v3
151165
with:
152166
xcode: ~26.0
153-
platform: ${{ matrix.platform[0] }}
154-
platform-version: ~${{ matrix.platform[1] }}
167+
platform: ${{ env.PLATFORM }}
168+
platform-version: ~${{ env.MAJOR }}.${{ env.MINOR }}
155169
action: build
156170
scheme: Showcase
157171
configuration: Debug
158172
verbosity: xcbeautify
159173

160-
- if: ${{ matrix.platform[0] == 'watchOS' }}
174+
- if: ${{ env.PLATFORM == 'watchOS' }}
161175
name: Build Library
162176
uses: mxcl/xcodebuild@v3
163177
with:
164178
xcode: ~26.0
165-
platform: ${{ matrix.platform[0] }}
166-
platform-version: ~${{ matrix.platform[1] }}
179+
platform: ${{ env.PLATFORM }}
180+
platform-version: ~${{ env.MAJOR }}.${{ env.MINOR }}
167181
action: build
168182
scheme: SwiftUIIntrospect
169183
configuration: Debug
170184
verbosity: xcbeautify
171185

172-
- if: ${{ matrix.platform[0] != 'watchOS' }}
186+
- if: ${{ env.PLATFORM != 'watchOS' }}
173187
name: Run Tests
174188
uses: mxcl/xcodebuild@v3
175189
with:
176190
xcode: ~26.0
177-
platform: ${{ matrix.platform[0] }}
178-
platform-version: ~${{ matrix.platform[1] }}
191+
platform: ${{ env.PLATFORM }}
192+
platform-version: ~${{ env.MAJOR }}.${{ env.MINOR }}
179193
action: test
180194
scheme: SwiftUIIntrospectTests
181195
configuration: Debug

0 commit comments

Comments
 (0)