-
Notifications
You must be signed in to change notification settings - Fork 0
292 lines (263 loc) · 8.82 KB
/
Copy pathpr-checks.yml
File metadata and controls
292 lines (263 loc) · 8.82 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
name: PR Fast Checks
on:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Fast test suite (lint + unit + integration)
fast-tests:
name: Fast Tests (Lint + Unit + Integration)
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Install Devbox
uses: jetify-com/devbox-install-action@v0.14.0
with:
enable-cache: true
- name: Run fast test suite
run: devbox run test:fast
- name: Upload reports and logs
if: always()
uses: actions/upload-artifact@v4
with:
name: fast-test-reports
path: |
reports/
retention-days: 7
# Android example E2E tests (min/max devices)
android-e2e:
name: Android E2E - ${{ matrix.device }}
runs-on: ubuntu-24.04
timeout-minutes: 30
needs: fast-tests
strategy:
fail-fast: false
matrix:
device: [min, max]
steps:
- uses: actions/checkout@v4
- 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@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install Devbox
uses: jetify-com/devbox-install-action@v0.14.0
with:
enable-cache: true
- name: Run Android E2E test
working-directory: examples/android
env:
EMU_HEADLESS: 1
BOOT_TIMEOUT: 180
TEST_TIMEOUT: 300
ANDROID_DEFAULT_DEVICE: ${{ matrix.device }}
TEST_TUI: false
run: devbox run --pure test:e2e
- name: Upload reports and logs
if: always()
uses: actions/upload-artifact@v4
with:
name: android-${{ matrix.device }}-reports
path: |
examples/android/reports/
examples/android/app/build/outputs/
retention-days: 7
# iOS example E2E tests (min/max devices)
ios-e2e:
name: iOS E2E - ${{ matrix.device }}
runs-on: ${{ matrix.os }}
timeout-minutes: 25
needs: fast-tests
strategy:
fail-fast: false
matrix:
include:
- device: min
os: macos-14
- device: max
os: macos-15
steps:
- uses: actions/checkout@v4
- name: Setup CocoaPods cache
uses: actions/cache@v4
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@v4
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.14.0
with:
enable-cache: true
- name: Run iOS E2E test
working-directory: examples/ios
env:
SIM_HEADLESS: 1
BOOT_TIMEOUT: 120
TEST_TIMEOUT: 300
IOS_DEFAULT_DEVICE: ${{ matrix.device }}
TEST_TUI: false
run: devbox run --pure test:e2e
- name: Upload reports and logs
if: always()
uses: actions/upload-artifact@v4
with:
name: ios-${{ matrix.device }}-reports
path: |
examples/ios/reports/
~/Library/Logs/CoreSimulator/
retention-days: 7
# React Native E2E tests (Android min/max, iOS min/max, Web)
react-native-e2e:
name: React Native E2E - ${{ matrix.platform }}-${{ matrix.device }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
needs: fast-tests
strategy:
fail-fast: false
matrix:
include:
# Android tests
- platform: android
device: min
os: ubuntu-24.04
- platform: android
device: max
os: ubuntu-24.04
# iOS tests
- platform: ios
device: min
os: macos-14
- platform: ios
device: max
os: macos-15
# Web test (fast, no device needed)
- platform: web
device: none
os: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup Node.js with cache
uses: actions/setup-node@v4
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@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup CocoaPods cache (iOS only)
if: matrix.platform == 'ios'
uses: actions/cache@v4
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@v4
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.14.0
with:
enable-cache: true
- name: Run React Native E2E test
working-directory: examples/react-native
env:
EMU_HEADLESS: ${{ matrix.platform == 'android' && '1' || '0' }}
SIM_HEADLESS: ${{ matrix.platform == 'ios' && '1' || '0' }}
BOOT_TIMEOUT: 240
TEST_TIMEOUT: 600
ANDROID_DEFAULT_DEVICE: ${{ matrix.device }}
IOS_DEFAULT_DEVICE: ${{ matrix.device }}
TEST_TUI: false
run: |
if [ "${{ matrix.platform }}" = "android" ]; then
# Use wrapper script for platform-specific optimization
bash tests/run-android-tests.sh
elif [ "${{ matrix.platform }}" = "ios" ]; then
# Use wrapper script for platform-specific optimization
bash tests/run-ios-tests.sh
elif [ "${{ matrix.platform }}" = "web" ]; then
devbox run test:e2e:web
fi
- name: Upload reports and logs
if: always()
uses: actions/upload-artifact@v4
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: [fast-tests, android-e2e, ios-e2e, react-native-e2e]
if: always()
steps:
- name: Check job results
run: |
echo "📊 PR Check Results:"
echo " Fast Tests: ${{ needs.fast-tests.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.fast-tests.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!"