-
Notifications
You must be signed in to change notification settings - Fork 0
282 lines (225 loc) · 7.36 KB
/
ci.yml
File metadata and controls
282 lines (225 loc) · 7.36 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
name: CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: "0"
jobs:
rust:
name: Rust lint and unit tests
runs-on: macos-15
env:
DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Rust build outputs
uses: actions/cache@v4
with:
path: |
~/.cargo/git
~/.cargo/registry
server/target
key: rust-${{ runner.os }}-${{ hashFiles('server/Cargo.lock', 'server/Cargo.toml', 'server/build.rs', 'server/src/**/*.rs', 'cli/**/*.m') }}
restore-keys: |
rust-${{ runner.os }}-
- name: Check Rust formatting
run: cargo fmt --manifest-path server/Cargo.toml --check
- name: Clippy
run: cargo clippy --manifest-path server/Cargo.toml --all-targets -- -D warnings
- name: Rust unit tests
run: cargo test --manifest-path server/Cargo.toml
client:
name: Client lint, build, and tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: |
package-lock.json
client/package-lock.json
- name: Install root dependencies
run: npm ci --ignore-scripts --force
- name: Install client dependencies
run: npm ci --prefix client
- name: Check Prettier formatting
run: npx prettier --check .
- name: Test studio provider bridge
run: npm run test:studio-provider
- name: Typecheck client
run: npm run --prefix client typecheck
- name: Test client
run: npm run --prefix client test
- name: Build client
run: npm run --prefix client build
packages:
name: Packages and VS Code extension
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: |
package-lock.json
packages/react-native-inspector/package-lock.json
packages/nativescript-inspector/package-lock.json
- name: Install root dependencies
run: npm ci --ignore-scripts --force
- name: Install NativeScript inspector dependencies
run: npm ci --prefix packages/nativescript-inspector
- name: Install React Native inspector dependencies
run: npm ci --prefix packages/react-native-inspector
- name: Build inspector and test packages
run: npm run build:packages
- name: Package VS Code extension
run: npm run package:vscode-extension
build-artifacts:
name: Build integration artifacts
runs-on: macos-15
env:
DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: |
package-lock.json
client/package-lock.json
- uses: dtolnay/rust-toolchain@stable
- name: Cache Rust build outputs and fixture app
uses: actions/cache@v4
with:
path: |
~/.cargo/git
~/.cargo/registry
server/target
.cache/simdeck/fixture
key: rust-${{ runner.os }}-${{ hashFiles('server/Cargo.lock', 'server/Cargo.toml', 'server/build.rs', 'server/src/**/*.rs', 'cli/**/*.m', 'scripts/integration/fixture.mjs') }}
restore-keys: |
rust-${{ runner.os }}-
- name: Install root dependencies
run: npm ci --ignore-scripts
- name: Install client dependencies
run: npm ci --prefix client
- name: Build CLI, client, and JS test API
run: |
npm run build:cli
npm run build:client
npm run build:simdeck-test
npm run test:integration:fixture
- name: Upload integration artifacts
uses: actions/upload-artifact@v4
with:
name: simdeck-integration-artifacts
if-no-files-found: error
include-hidden-files: true
path: |
build/simdeck
build/simdeck-bin
client/dist
packages/simdeck-test/dist
.cache/simdeck/fixture
integration-cli:
name: CLI simulator integration
runs-on: macos-15
env:
DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer
needs:
- rust
- client
- packages
- build-artifacts
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Download integration artifacts
uses: actions/download-artifact@v4
with:
name: simdeck-integration-artifacts
path: .
- name: Make CLI executable
run: chmod +x build/simdeck build/simdeck-bin
- name: CLI simulator integration tests
run: npm run test:integration:cli
env:
SIMDECK_INTEGRATION_VERBOSE: "1"
integration-js-api:
name: JS API simulator integration
runs-on: macos-15
env:
DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer
needs:
- rust
- client
- packages
- build-artifacts
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Download integration artifacts
uses: actions/download-artifact@v4
with:
name: simdeck-integration-artifacts
path: .
- name: Make CLI executable
run: chmod +x build/simdeck build/simdeck-bin
- name: JS API simulator integration tests
run: npm run test:integration:js-api
integration-android:
name: Android emulator integration
runs-on: ubuntu-latest
timeout-minutes: 35
needs:
- client
- packages
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- uses: dtolnay/rust-toolchain@stable
- name: Enable KVM access
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Install root dependencies
run: npm ci --ignore-scripts --force
- name: Build Linux Android integration artifacts
run: |
npm run build:cli
npm run build:simdeck-test
- name: Android emulator integration tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 35
target: google_apis
arch: x86_64
profile: pixel_6
avd-name: SimDeck_Pixel_CI
disable-animations: true
script: npm run test:integration:android
env:
SIMDECK_INTEGRATION_ANDROID_AVD: SimDeck_Pixel_CI
SIMDECK_INTEGRATION_REQUIRE_RUNNING_ANDROID: "1"
SIMDECK_INTEGRATION_VERBOSE: "1"