-
Notifications
You must be signed in to change notification settings - Fork 418
241 lines (211 loc) · 7.29 KB
/
Copy pathci.yml
File metadata and controls
241 lines (211 loc) · 7.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- "**"
schedule:
- cron: "3 3 * * 2" # 3:03 AM, every Tuesday
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-podspec:
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.title, '[skip ci]')
name: Lint Podspec
runs-on: macos-15
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # required to be able to find Git tags
- name: Select Xcode version
run: sudo xcodes select 16.4
- name: Install Runtimes
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
max_attempts: 3
command: xcodebuild -downloadAllPlatforms
- name: Lint Podspec
run: |
set -eo pipefail
export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
pod lib lint SwiftUIIntrospect.podspec --allow-warnings
ci:
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.title, '[skip ci]')
name: ${{ matrix.runtime[0] }} ${{ matrix.runtime[1] }}
runs-on: macos-15
strategy:
fail-fast: false
matrix:
runtime:
- [iOS, 15, 5]
- [iOS, 16, 4]
- [iOS, 17, 5]
- [iOS, 18, 6]
- [iOS, 26, 0]
- [iPadOS, 15, 5]
- [iPadOS, 16, 4]
- [iPadOS, 17, 5]
- [iPadOS, 18, 6]
- [iPadOS, 26, 0]
- [macCatalyst, 15, 0]
- [macOS, 15, 0]
- [tvOS, 15, 4]
- [tvOS, 16, 4]
- [tvOS, 17, 5]
- [tvOS, 18, 5]
- [tvOS, 26, 0]
- [visionOS, 1, 2]
- [visionOS, 2, 5]
- [visionOS, 26, 0]
- [watchOS, 8, 5]
- [watchOS, 9, 4]
- [watchOS, 10, 5]
- [watchOS, 11, 5]
- [watchOS, 26, 0]
steps:
- name: Git Checkout
uses: actions/checkout@v5
- name: Set Environment Variables
run: |
set -euo pipefail
PLATFORM="${{ matrix.runtime[0] }}"
MAJOR="${{ matrix.runtime[1] }}"
MINOR="${{ matrix.runtime[2] }}"
if [ "$PLATFORM" = "iPadOS" ]; then
PLATFORM=iOS
SCRIPT_PLATFORM=ipados
else
case "$PLATFORM" in
iOS) SCRIPT_PLATFORM=ios ;;
macOS) SCRIPT_PLATFORM=macos ;;
macCatalyst) SCRIPT_PLATFORM=mac-catalyst ;;
tvOS) SCRIPT_PLATFORM=tvos ;;
visionOS) SCRIPT_PLATFORM=visionos ;;
watchOS) SCRIPT_PLATFORM=watchos ;;
esac
fi
if [ "$PLATFORM" = "macCatalyst" ]; then
XCB_PLATFORM="mac-catalyst"
else
XCB_PLATFORM="$PLATFORM"
fi
RUNTIME="$PLATFORM $MAJOR.$MINOR"
echo "PLATFORM=$PLATFORM" >> $GITHUB_ENV
echo "MAJOR=$MAJOR" >> $GITHUB_ENV
echo "MINOR=$MINOR" >> $GITHUB_ENV
echo "RUNTIME=$RUNTIME" >> $GITHUB_ENV
echo "SCRIPT_PLATFORM=$SCRIPT_PLATFORM" >> $GITHUB_ENV
- if: ${{ env.PLATFORM != 'macCatalyst' && env.PLATFORM != 'macOS' }}
name: Check for ${{ env.RUNTIME }} runtime
run: |
if xcrun simctl list runtimes | grep -q "$RUNTIME"; then
echo "has_runtime=true" >> "$GITHUB_ENV"
else
echo "has_runtime=false" >> "$GITHUB_ENV"
fi
- name: Select Xcode 26.0
uses: mxcl/xcodebuild@v3
with:
xcode: ~26.0
action: none
verbosity: xcbeautify
- if: env.has_runtime == 'false'
name: List Downloadable Runtimes
run: xcodes runtimes --include-betas
- if: env.has_runtime == 'false'
name: Download Required Runtime (${{ env.RUNTIME }})
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
max_attempts: 3
command: sudo xcodes runtimes install "$RUNTIME"
- if: ${{ env.PLATFORM != 'macCatalyst' && env.PLATFORM != 'macOS' }}
name: Create Required Simulators
run: |
set -eo pipefail
xcrun simctl delete all
OUTPUT=$(script/create_simulators --platform ${{ env.SCRIPT_PLATFORM }} --version ${{ env.MAJOR }} | tee /dev/stderr)
FIRST_UDID=$(printf "%s\n" "$OUTPUT" | awk '/^(Created:|Already exists:)/{print $NF}' | head -n1)
if [ -n "$FIRST_UDID" ]; then
echo "SIM_UDID=$FIRST_UDID" >> "$GITHUB_ENV"
echo "Captured SIM_UDID=$FIRST_UDID"
fi
- name: List Available Runtimes, Simulators, and Destinations
run: |
xcrun simctl list
xcodebuild -scheme "SwiftUIIntrospect" -showdestinations
- if: ${{ env.PLATFORM != 'watchOS' }}
name: Build Showcase
uses: davdroman/xcodebuild@destination
with:
xcode: ~26.0
platform: ${{ env.XCB_PLATFORM }}
platform-version: ~${{ env.MAJOR }}.${{ env.MINOR }}
destination: ${{ env.SIM_UDID }}
action: build
scheme: Showcase
configuration: Debug
verbosity: xcbeautify
- if: ${{ env.PLATFORM == 'watchOS' }}
name: Build Library
uses: davdroman/xcodebuild@destination
with:
xcode: ~26.0
platform: ${{ env.XCB_PLATFORM }}
platform-version: ~${{ env.MAJOR }}.${{ env.MINOR }}
destination: ${{ env.SIM_UDID }}
action: build
scheme: SwiftUIIntrospect
configuration: Debug
verbosity: xcbeautify
- if: ${{ env.PLATFORM != 'watchOS' }}
name: Run Tests
uses: davdroman/xcodebuild@destination
with:
xcode: ~26.0
platform: ${{ env.XCB_PLATFORM }}
platform-version: ~${{ env.MAJOR }}.${{ env.MINOR }}
destination: ${{ env.SIM_UDID }}
action: test
scheme: SwiftUIIntrospectTests
configuration: Debug
verbosity: xcbeautify
framework-archiving:
if: github.event_name != 'pull_request' || !contains(github.event.pull_request.title, '[skip ci]')
name: Archive Framework (${{ matrix.platform }})
runs-on: macos-15
strategy:
fail-fast: false
matrix:
platform: [iOS, macCatalyst, macOS, tvOS, visionOS, watchOS]
include:
- platform: iOS
destination: "generic/platform=iOS"
- platform: macCatalyst
destination: "platform=macOS,variant=Mac Catalyst"
- platform: macOS
destination: "generic/platform=macOS"
- platform: tvOS
destination: "generic/platform=tvOS"
- platform: visionOS
destination: "generic/platform=visionOS"
- platform: watchOS
destination: "generic/platform=watchOS"
steps:
- name: Git Checkout
uses: actions/checkout@v5
- name: Select Xcode version
run: sudo xcodes select 16.4
- name: Archive Framework
run: |
xcodebuild archive \
-scheme "SwiftUIIntrospectTestFramework" \
-destination "${{ matrix.destination }}" \
-archivePath .build/archiving/${{ matrix.platform }} \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES