forked from livekit/client-sdk-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (150 loc) · 5.16 KB
/
ci.yaml
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
name: CI
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:
TESTS: "FunctionTests SDKTests RoomTests PublishDataTests PublishBufferCapturerTests VideoViewTests TrackTests"
jobs:
build-and-test:
name: Build & Test
strategy:
fail-fast: false
matrix:
include:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
- os: macos-13
xcode: 14.2
platform: "iOS Simulator,OS=17.2,name=iPhone 14 Pro"
- os: macos-13
xcode: 14.2
platform: "macOS"
- os: macos-13
xcode: 14.2
platform: "macOS,variant=Mac Catalyst"
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
- os: macos-14
xcode: 15.4
platform: "iOS Simulator,OS=17.5,name=iPhone 15 Pro"
- 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: "visionOS Simulator,name=Apple Vision Pro"
- os: macos-14
xcode: 15.4
platform: "tvOS Simulator,name=Apple TV"
# https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
- os: macos-15
xcode: 16.2
platform: "iOS Simulator,OS=18.1,name=iPhone 16 Pro"
symbol-graph: true
- os: macos-15
xcode: 16.2
platform: "macOS"
symbol-graph: true
- os: macos-15
xcode: 16.2
platform: "macOS,variant=Mac Catalyst"
runs-on: ${{ matrix.os }}
timeout-minutes: 30
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 }}' | xcbeautify --renderer github-actions
# Run all tests in parallel instead of sequentially
- name: Run Tests
run: |
IFS=' ' read -r -a tests <<< "${{ env.TESTS }}"
for test in "${tests[@]}"; do
echo "::group::Running test $test"
set -o pipefail && xcodebuild test-without-building \
-scheme LiveKit \
-destination 'platform=${{ matrix.platform }}' \
-only-testing:LiveKitTests/$test | xcbeautify --renderer github-actions
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 }}' \
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
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 client-sdk-swift/
- name: Archive
run: zip -r docs@${{ github.ref_name }}.zip docs
- name: Upload Archive
uses: actions/upload-artifact@v4
with:
name: docs@${{ github.ref_name }}
path: docs@${{ github.ref_name }}.zip
retention-days: 1