-
Notifications
You must be signed in to change notification settings - Fork 222
335 lines (301 loc) · 10.8 KB
/
Copy pathci.yaml
File metadata and controls
335 lines (301 loc) · 10.8 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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
name: CI
permissions:
contents: read
pull-requests: write
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
TEST_TIMEOUT_MINUTES: 30
# TEMPORARY: 1 so any flake fails the job and the log artifacts actually
# upload. Restore to 3 before merging.
TEST_RETRY_ATTEMPTS: 1
jobs:
build-and-test:
name: Build & Test
strategy:
fail-fast: false
matrix:
include:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
- os: macos-15
xcode: 16.4
platform: "iOS Simulator,name=iPhone 16 Pro,OS=18.5"
- os: macos-15
xcode: 16.4
platform: "macOS"
- os: macos-15
xcode: 16.4
platform: "macOS,variant=Mac Catalyst"
- os: macos-15
xcode: 16.4
platform: "tvOS Simulator,name=Apple TV,OS=18.5"
# https://github.com/actions/runner-images/blob/main/images/macos/macos-26-arm64-Readme.md
- os: macos-26
xcode: 26.6
platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.5"
symbol-graph: true
- os: macos-26
xcode: 26.6
platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.5"
extension-api-only: true
- os: macos-26
xcode: 26.6
platform: "macOS"
symbol-graph: true
- os: macos-26
xcode: 26.6
platform: "macOS"
asan: true
- os: macos-26
xcode: 26.6
platform: "macOS"
tsan: true
- os: macos-26
xcode: 26.6
platform: "macOS"
strict-concurrency-env: true
- os: macos-26
xcode: 26.6
platform: "macOS,variant=Mac Catalyst"
- os: macos-26
xcode: 26.6
platform: "visionOS Simulator,name=Apple Vision Pro,OS=26.5"
- os: macos-26
xcode: 26.6
platform: "tvOS Simulator,name=Apple TV,OS=26.5"
# https://github.com/actions/runner-images/blob/main/images/macos/xcode-27-Readme.md
- os: xcode-27
xcode: latest
platform: "macOS"
- os: xcode-27
xcode: latest
platform: "macOS,variant=Mac Catalyst"
- os: xcode-27
xcode: latest
platform: "iOS Simulator,name=iPhone 17 Pro,OS=27.0"
- os: xcode-27
xcode: latest
platform: "visionOS Simulator,name=Apple Vision Pro,OS=27.0"
# This image has no plain "Apple TV" device, unlike macos-15/macos-26.
- os: xcode-27
xcode: latest
platform: "tvOS Simulator,name=Apple TV 4K (3rd generation),OS=27.0"
runs-on: ${{ matrix.os }}
timeout-minutes: 60
env:
LIBDISPATCH_COOPERATIVE_POOL_STRICT: ${{ matrix.strict-concurrency-env == true && '1' || '0' }}
NSUnbufferedIO: "YES"
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v7
- name: Run LiveKit Server
id: livekit-server
uses: livekit/dev-server-action@61e2b4dcb170dd3591e0c9b0db3c3fe5db93b500
with:
github-token: ${{ github.token }}
config: 'room: { departure_timeout: 1 }'
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- name: Xcode Version
run: xcodebuild -version
- name: Swift Version
run: xcrun swift --version
- name: Build & Test
uses: nick-fields/retry@v4
with:
timeout_minutes: ${{ env.TEST_TIMEOUT_MINUTES }}
max_attempts: ${{ env.TEST_RETRY_ATTEMPTS }}
command: |
set -o pipefail && xcodebuild test \
-scheme LiveKit \
-destination 'platform=${{ matrix.platform }}' \
-enableAddressSanitizer ${{ matrix.asan == true && 'YES' || 'NO' }} \
-enableThreadSanitizer ${{ matrix.tsan == true && 'YES' || 'NO' }} \
APPLICATION_EXTENSION_API_ONLY=${{ matrix.extension-api-only == true && 'YES' || 'NO' }} \
-only-testing:LiveKitCoreTests \
-only-testing:LiveKitObjCTests \
-parallel-testing-enabled NO \
| tee -a "$RUNNER_TEMP/xcodebuild.log" \
| xcbeautify --renderer github-actions
# xcbeautify's github-actions renderer collapses a parameterized Swift Testing
# failure to "Recorded an issue (1) argument(s)" — no message, no failing
# argument. xcodebuild's own output has both, so keep it for post-mortems
# instead of re-running CI blind. Appended across retry attempts.
- name: Upload Test Log
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: test-log-${{ strategy.job-index }}
path: ${{ runner.temp }}/xcodebuild.log
retention-days: 5
# Client-side logs can't distinguish "we gave up" from "the SFU hung up on
# us": a failed e2e test just shows `Connection reset by peer`. The server's
# JSONL log records the participant close reason, so capture both sides.
- name: Upload Server Log
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: server-log-${{ strategy.job-index }}
path: ${{ steps.livekit-server.outputs.log-path }}
retention-days: 5
- name: Build for Release
if: ${{ matrix.symbol-graph }}
run: |
set -o pipefail && xcodebuild build\
-scheme LiveKit \
-configuration Release \
-destination 'platform=${{ matrix.platform }}' \
APPLICATION_EXTENSION_API_ONLY=${{ matrix.extension-api-only == true && 'YES' || 'NO' }} \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
OTHER_SWIFT_FLAGS="-Xfrontend -emit-symbol-graph\
-Xfrontend -emit-symbol-graph-dir\
-Xfrontend \"${PWD}/symbol-graph\"" \
DOCC_EXTRACT_EXTENSION_SYMBOLS=YES | xcbeautify --renderer github-actions
- name: Upload Symbol Graph
if: ${{ matrix.symbol-graph }}
uses: actions/upload-artifact@v7
with:
name: symbol-graph-${{ matrix.platform }}
path: symbol-graph
retention-days: 1
lint:
name: Lint
runs-on: macos-26
steps:
- uses: actions/checkout@v7
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install SwiftLint
run: brew install swiftlint
- name: SwiftLint
run: swiftlint lint --strict --reporter github-actions-logging
- name: SwiftFormat Lint
if: always()
run: swiftformat --lint . --reporter github-actions-log
# Comes pre-installed on macOS runners
build-docs:
name: Build Docs
needs: build-and-test
if: always()
runs-on: macos-26
steps:
- name: Checkout Documentation Catalog
uses: actions/checkout@v7
with:
sparse-checkout: Sources/LiveKit/LiveKit.docc
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Download Symbol Graphs
uses: actions/download-artifact@v8
with:
pattern: symbol-graph-*
path: symbol-graphs
- name: List Symbol Graphs
run: cd symbol-graphs && ls -al
- name: Build Docs
run: |
$(xcrun --find docc) convert \
Sources/LiveKit/LiveKit.docc \
--output-dir docs \
--additional-symbol-graph-dir symbol-graphs \
--transform-for-static-hosting \
--hosting-base-path /reference/client-sdk-swift/
- name: Archive
run: zip -r docs.zip docs
- name: Upload Archive
uses: actions/upload-artifact@v7
with:
name: docs
path: docs.zip
retention-days: 1
app-size:
name: App Size
runs-on: macos-26
timeout-minutes: 30
env:
# Budget for the SDK's uncompressed .app delta, in MB. Bump deliberately
# when a size increase is intended (see the job summary for the measured value).
SIZE_BASELINE_MB: "17.5"
SIZE_TOLERANCE_PCT: "5"
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install tools
run: |
brew install xcodegen swiftly swift-sh
swiftly init --quiet-shell-followup --skip-install -y
# Archives an empty app + a LiveKit app (unsigned, arm64 device slice) and
# writes the size breakdown to the job summary, failing if over budget.
- name: Measure app size
run: |
swiftly run +xcode swift-sh .github/size-check/size-check.swift \
--baseline "$SIZE_BASELINE_MB" \
--tolerance "$SIZE_TOLERANCE_PCT"
check-protocol:
name: Check Protocol
runs-on: macos-26
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Install swift-protobuf
run: brew install protobuf swift-protobuf
- name: Generate Swift protobuf files
run: make proto
- name: Check working tree
run: |
if ! git diff --quiet; then
echo "::error::Working tree is not clean after running 'make proto'"
echo "The following files have been modified:"
git diff --name-only
echo ""
echo "Please run 'make proto' locally and commit the changes."
exit 1
else
echo "Working tree is clean - all Swift protobuf files are up to date"
fi
check-changes:
name: Check Changes
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Check for .changes files
id: check-changes
run: |
if [ -z "$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '^\.changes/')" ]; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Comment on PR
if: steps.check-changes.outputs.has_changes == 'false'
uses: mshick/add-pr-comment@v3
with:
message: |
⚠️ This PR does not contain any files in the `.changes` directory.
repo-token: ${{ secrets.GITHUB_TOKEN }}