-
Notifications
You must be signed in to change notification settings - Fork 0
378 lines (328 loc) · 12.2 KB
/
Copy pathpr-checks.yml
File metadata and controls
378 lines (328 loc) · 12.2 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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
name: PR Fast Checks
on:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Linting and formatting checks
lint:
name: Lint
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- name: Install Devbox
uses: jetify-com/devbox-install-action@v0.15.0
with:
enable-cache: true
- name: Run linting
run: devbox run lint
# Shell script unit tests (no SDK required)
test-shell-scripts:
name: Shell Script Tests
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Install Devbox
uses: jetify-com/devbox-install-action@v0.15.0
with:
enable-cache: true
- name: Run Android lib.sh tests
run: devbox run bash plugins/tests/android/test-lib.sh
- name: Run Android apk-resolution tests
run: devbox run bash plugins/tests/android/test-apk-resolution.sh
- name: Run iOS lib.sh tests
run: devbox run bash plugins/tests/ios/test-lib.sh
- name: Run iOS app-resolution tests
run: devbox run bash plugins/tests/ios/test-app-resolution.sh
- name: Run React Native lib.sh tests
run: devbox run bash plugins/tests/react-native/test-lib.sh
- name: Upload logs
if: always()
uses: actions/upload-artifact@v7
with:
name: shell-script-test-logs
path: reports/logs/
retention-days: 7
# Device config tests (no SDK build, just config validation)
test-device-config:
name: Device Config Tests
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Install Devbox
uses: jetify-com/devbox-install-action@v0.15.0
with:
enable-cache: true
- name: Run Android device config tests
env:
ANDROID_SDK_REQUIRED: "0"
run: devbox run bash plugins/tests/android/test-devices.sh
- name: Run iOS device config tests
env:
IOS_SDK_REQUIRED: "0"
run: devbox run bash plugins/tests/ios/test-devices.sh
- name: Upload logs
if: always()
uses: actions/upload-artifact@v7
with:
name: device-config-test-logs
path: reports/logs/
retention-days: 7
# Android example E2E test (max device only on PRs)
# Runs in parallel with fast checks for better CI throughput
android-e2e:
name: Android E2E - max
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- name: Enable KVM
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: Setup Gradle cache
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Free disk space
run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc \
/usr/local/share/powershell /usr/local/share/chromium \
/usr/local/share/boost /opt/hostedtoolcache
sudo apt-get clean
df -h /
- name: Install Devbox
uses: jetify-com/devbox-install-action@v0.15.0
with:
enable-cache: true
- name: Rewrite plugin URLs to local
run: bash scripts/dev/rewrite-plugin-urls.sh --to-local examples/
- name: Run Android apk-detection tests
working-directory: examples/android
run: devbox run bash ../../plugins/tests/android/test-apk-detection.sh
- name: Run Android E2E test
working-directory: examples/android
env:
BOOT_TIMEOUT: 180
TEST_TIMEOUT: 300
ANDROID_DEFAULT_DEVICE: max
ANDROID_DEVICES: max
TEST_TUI: false
run: devbox run --pure -e EMU_HEADLESS=1 -e ANDROID_DEVICES=max test:e2e
- name: Upload reports and logs
if: always()
uses: actions/upload-artifact@v7
with:
name: android-max-reports
path: |
examples/android/reports/
examples/android/app/build/outputs/
retention-days: 7
# iOS example E2E test (max device only on PRs)
# Runs in parallel with fast checks for better CI throughput
ios-e2e:
name: iOS E2E - max
runs-on: macos-26
timeout-minutes: 25
steps:
- uses: actions/checkout@v6
- name: Select pinned Xcode
run: |
XCODE_VERSION=$(jq -r '.env.IOS_XCODE_VERSION' plugins/ios/plugin.json)
XCODE_APP=$(ls -d /Applications/Xcode_${XCODE_VERSION}*.app 2>/dev/null | head -1)
if [ -z "$XCODE_APP" ]; then
XCODE_APP="/Applications/Xcode.app"
fi
echo "Selecting: $XCODE_APP"
sudo xcode-select -s "$XCODE_APP/Contents/Developer"
xcodebuild -version
xcrun simctl list runtimes | grep -i ios
- name: Setup CocoaPods cache
uses: actions/cache@v5
with:
path: |
~/.cocoapods/repos
~/Library/Caches/CocoaPods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Setup Xcode build cache
uses: actions/cache@v5
with:
path: |
~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-xcode-${{ hashFiles('**/*.xcodeproj/**', '**/*.xcworkspace/**') }}
restore-keys: |
${{ runner.os }}-xcode-
- name: Install Devbox
uses: jetify-com/devbox-install-action@v0.15.0
with:
enable-cache: true
- name: Rewrite plugin URLs to local
run: bash scripts/dev/rewrite-plugin-urls.sh --to-local examples/
- name: Run iOS E2E test
working-directory: examples/ios
env:
BOOT_TIMEOUT: 120
TEST_TIMEOUT: 300
IOS_DEFAULT_DEVICE: max
TEST_TUI: false
run: devbox run --pure -e SIM_HEADLESS=1 -e IOS_DEVICES=max test:e2e
- name: Upload reports and logs
if: always()
uses: actions/upload-artifact@v7
with:
name: ios-max-reports
path: |
examples/ios/reports/
~/Library/Logs/CoreSimulator/
retention-days: 7
# React Native E2E tests (max device only on PRs, plus web)
# Runs in parallel with fast checks for better CI throughput
react-native-e2e:
name: React Native E2E - ${{ matrix.platform }}-${{ matrix.device }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- platform: android
device: max
os: ubuntu-24.04
- platform: ios
device: max
os: macos-26
- platform: web
device: none
os: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Setup Node.js with cache
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: examples/react-native/package-lock.json
- name: Enable KVM (Android only)
if: matrix.platform == 'android'
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: Setup Gradle cache (Android only)
if: matrix.platform == 'android'
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Select pinned Xcode (iOS only)
if: matrix.platform == 'ios'
run: |
XCODE_VERSION=$(jq -r '.env.IOS_XCODE_VERSION' plugins/ios/plugin.json)
XCODE_APP=$(ls -d /Applications/Xcode_${XCODE_VERSION}*.app 2>/dev/null | head -1)
if [ -z "$XCODE_APP" ]; then
XCODE_APP="/Applications/Xcode.app"
fi
echo "Selecting: $XCODE_APP"
sudo xcode-select -s "$XCODE_APP/Contents/Developer"
xcodebuild -version
xcrun simctl list runtimes | grep -i ios
- name: Setup CocoaPods cache (iOS only)
if: matrix.platform == 'ios'
uses: actions/cache@v5
with:
path: |
~/.cocoapods/repos
~/Library/Caches/CocoaPods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Setup Xcode build cache (iOS only)
if: matrix.platform == 'ios'
uses: actions/cache@v5
with:
path: |
~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-xcode-${{ hashFiles('**/*.xcodeproj/**', '**/*.xcworkspace/**') }}
restore-keys: |
${{ runner.os }}-xcode-
- name: Free disk space (Android only)
if: matrix.platform == 'android'
run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc \
/usr/local/share/powershell /usr/local/share/chromium \
/usr/local/share/boost /opt/hostedtoolcache
sudo apt-get clean
df -h /
- name: Install Devbox
uses: jetify-com/devbox-install-action@v0.15.0
with:
enable-cache: true
- name: Rewrite plugin URLs to local
run: bash scripts/dev/rewrite-plugin-urls.sh --to-local examples/
- name: Run React Native E2E test
working-directory: examples/react-native
run: |
if [ "${{ matrix.platform }}" = "android" ]; then
devbox run --pure -e IOS_SKIP_SETUP=1 -e EMU_HEADLESS=1 -e ANDROID_DEVICES=max test:e2e:android
elif [ "${{ matrix.platform }}" = "ios" ]; then
devbox run --pure -e ANDROID_SKIP_SETUP=1 -e SIM_HEADLESS=1 -e IOS_DEVICES=max test:e2e:ios
elif [ "${{ matrix.platform }}" = "web" ]; then
devbox run --pure -e ANDROID_SKIP_SETUP=1 -e IOS_SKIP_SETUP=1 test:e2e:web
fi
- name: Upload reports and logs
if: always()
uses: actions/upload-artifact@v7
with:
name: react-native-${{ matrix.platform }}-${{ matrix.device }}-reports
path: |
examples/react-native/reports/
examples/react-native/android/app/build/outputs/
examples/react-native/ios/build/
~/Library/Logs/CoreSimulator/
retention-days: 7
# Summary status check
status-check:
name: All PR Checks Passed
runs-on: ubuntu-latest
needs: [lint, test-shell-scripts, test-device-config, android-e2e, ios-e2e, react-native-e2e]
if: always()
steps:
- name: Check job results
run: |
echo "PR Check Results:"
echo " Lint: ${{ needs.lint.result }}"
echo " Shell Script Tests: ${{ needs.test-shell-scripts.result }}"
echo " Device Config Tests: ${{ needs.test-device-config.result }}"
echo " Android E2E: ${{ needs.android-e2e.result }}"
echo " iOS E2E: ${{ needs.ios-e2e.result }}"
echo " React Native E2E: ${{ needs.react-native-e2e.result }}"
echo ""
if [[ "${{ needs.lint.result }}" != "success" ]] || \
[[ "${{ needs.test-shell-scripts.result }}" != "success" ]] || \
[[ "${{ needs.test-device-config.result }}" != "success" ]] || \
[[ "${{ needs.android-e2e.result }}" != "success" ]] || \
[[ "${{ needs.ios-e2e.result }}" != "success" ]] || \
[[ "${{ needs.react-native-e2e.result }}" != "success" ]]; then
echo "::error::One or more PR checks failed"
exit 1
fi
echo "::notice::All PR checks passed!"