-
Notifications
You must be signed in to change notification settings - Fork 209
273 lines (245 loc) · 8.59 KB
/
Copy pathci.yaml
File metadata and controls
273 lines (245 loc) · 8.59 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
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_TARGETS: "LiveKitCoreTests LiveKitObjCTests"
TEST_TIMEOUT_MINUTES: 15
TEST_RETRY_ATTEMPTS: 3
jobs:
build-and-test:
name: Build & Test
strategy:
fail-fast: false
matrix:
include:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
- os: macos-14
xcode: 15.4
platform: "iOS Simulator,name=iPhone 15 Pro,OS=17.5"
- os: macos-14
xcode: 15.4
platform: "macOS"
- os: macos-14
xcode: 15.4
platform: "macOS,variant=Mac Catalyst"
- os: macos-14
xcode: 15.4
platform: "tvOS Simulator,name=Apple TV,OS=17.5"
# 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: "visionOS Simulator,name=Apple Vision Pro,OS=2.5"
- 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: latest
platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.2"
symbol-graph: true
- os: macos-26
xcode: latest
platform: "iOS Simulator,name=iPhone 17 Pro,OS=26.2"
extension-api-only: true
- os: macos-26
xcode: latest
platform: "macOS"
symbol-graph: true
- os: macos-26
xcode: latest
platform: "macOS"
asan: true
- os: macos-26
xcode: latest
platform: "macOS"
tsan: true
- os: macos-26
xcode: latest
platform: "macOS,variant=Mac Catalyst"
- os: macos-26
xcode: latest
platform: "visionOS Simulator,name=Apple Vision Pro,OS=26.2"
- os: macos-26
xcode: latest
platform: "tvOS Simulator,name=Apple TV,OS=26.2"
runs-on: ${{ matrix.os }}
timeout-minutes: 60
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Install LiveKit Server
run: brew install livekit
- name: Run LiveKit Server
run: livekit-server --dev &
- 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 for Testing
run: |
set -o pipefail && xcodebuild build-for-testing \
-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' }} \
| xcbeautify --renderer github-actions
- name: Run Tests
uses: nick-fields/retry@v3
with:
timeout_minutes: ${{ env.TEST_TIMEOUT_MINUTES }}
max_attempts: ${{ env.TEST_RETRY_ATTEMPTS }}
command: |
set -euo pipefail
IFS=' ' read -r -a tests <<< "${{ env.TEST_TARGETS }}"
for test in "${tests[@]}"; do
echo "::group::$test"
if ! xcodebuild test-without-building \
-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:$test \
-parallel-testing-enabled NO \
| xcbeautify --renderer github-actions
then
echo "::error::Test failed: $test"
exit 1
fi
echo "::endgroup::"
done
- 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@v4
with:
name: symbol-graph-${{ matrix.platform }}
path: symbol-graph
retention-days: 1
lint:
name: Lint
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: SwiftFormat Lint
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-15
steps:
- name: Checkout Documentation Catalog
uses: actions/checkout@v4
with:
sparse-checkout: Sources/LiveKit/LiveKit.docc
- name: Download Symbol Graphs
uses: actions/download-artifact@v4
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@v4
with:
name: docs
path: docs.zip
retention-days: 1
check-protocol:
name: Check Protocol
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- 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@v4
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@v2
with:
message: |
⚠️ This PR does not contain any files in the `.changes` directory.
repo-token: ${{ secrets.GITHUB_TOKEN }}