-
-
Notifications
You must be signed in to change notification settings - Fork 337
611 lines (548 loc) · 24.2 KB
/
e2e.yml
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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
name: End-to-End Tests
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
jobs:
diff_check:
uses: ./.github/workflows/skip-ci.yml
cancel-previous-workflow:
runs-on: ubuntu-latest
needs: [diff_check]
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@01ce38bf961b4e243a6342cbade0dbc8ba3f0432 # [email protected]
with:
access_token: ${{ github.token }}
metrics:
runs-on: ${{ matrix.runs-on }}
needs: [diff_check]
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
env:
SENTRY_DISABLE_AUTO_UPLOAD: 'true'
strategy:
# we want that the matrix keeps running, default is to cancel them if it fails.
fail-fast: false
matrix:
rn-architecture: ['legacy', 'new']
platform: ["ios", "android"]
include:
- platform: ios
runs-on: macos-12
name: iOS
appPlain: test/perf/test-app-plain.ipa
- platform: android
runs-on: ubuntu-latest
name: Android
appPlain: test/perf/TestAppPlain/android/app/build/outputs/apk/release/app-release.apk
steps:
- uses: actions/checkout@v4
- run: sudo xcode-select -s /Applications/Xcode_14.2.app/Contents/Developer
if: ${{ matrix.platform == 'ios' }}
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: "adopt"
- name: Gradle cache
uses: gradle/gradle-build-action@v3
- name: Install Global Dependencies
run: yarn global add react-native-cli @sentry/cli yalc
- uses: actions/cache@v4
id: deps-cache
with:
path: |
node_modules
test/perf/TestAppSentry/node_modules
key: ${{ github.workflow }}-${{ github.job }}-${{ hashFiles('yarn.lock', 'test/perf/TestAppSentry/yarn.lock') }}
- name: Install Dependencies
if: steps.deps-cache.outputs['cache-hit'] != 'true'
run: yarn install
- name: Build SDK
run: yarn build
- name: Package SDK
run: yalc publish
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/cache@v4
id: app-plain-cache
with:
path: ${{ matrix.appPlain }}
# if the whole plain app folder is hashed the cache is never hit as there are files generated in the folder
# the cache key is calculated both at cache retrieval and save time
# hashFiles fails when there are rn android new arch generated files in the folder (exact reason unknown)
key: ${{ github.workflow }}-${{ github.job }}-appplain-${{ matrix.platform }}-${{ matrix.rn-architecture }}-${{ hashFiles('test/perf/TestAppPlain/yarn.lock') }}
- name: Build app plain
if: steps.app-plain-cache.outputs['cache-hit'] != 'true'
working-directory: ./test/perf/TestAppPlain
run: |
yarn install
cd ${{ matrix.platform }}
if [[ "${{ matrix.platform }}" == "android" ]]; then
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
fi
./gradlew assembleRelease
else
export PRODUCTION=1
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
export RCT_NEW_ARCH_ENABLED=1
fi
pod install
cd ../..
fastlane build_perf_test_app_plain
fi
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
- name: Build app with Sentry
working-directory: ./test/perf/TestAppSentry
run: |
yalc add @sentry/react-native
yarn install
cd ${{ matrix.platform }}
if [[ "${{ matrix.platform }}" == "android" ]]; then
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
fi
./gradlew assembleRelease
else
export PRODUCTION=1
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
export RCT_NEW_ARCH_ENABLED=1
fi
pod install
cd ../..
fastlane build_perf_test_app_sentry
cd TestAppSentry
fi
# Remove after build so that the cache isn't invaldiated due to the changes in yarn.lock.
yarn remove @sentry/react-native
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
- name: Collect apps metrics
uses: getsentry/action-app-sdk-overhead-metrics@v1
with:
name: ${{ matrix.name }} (${{ matrix.rn-architecture }})
config: ./test/perf/metrics-${{ matrix.platform }}.yml
sauce-user: ${{ secrets.SAUCE_USERNAME }}
sauce-key: ${{ secrets.SAUCE_ACCESS_KEY }}
react-native-build:
name: Build RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.engine }} ${{ matrix.platform }} ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks }}
runs-on: ${{ matrix.runs-on }}
needs: [diff_check]
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
env:
SENTRY_DISABLE_AUTO_UPLOAD: 'true' # TODO: Remove this when testing against a mocked Sentry server
RN_SENTRY_POD_NAME: RNSentry
RN_DIFF_REPOSITORY: https://github.com/react-native-community/rn-diff-purge.git
strategy:
fail-fast: false # keeps matrix running if one fails
matrix:
rn-version: ['0.65.3', '0.73.2']
rn-architecture: ['legacy', 'new']
platform: ['android', 'ios']
build-type: ['production']
ios-use-frameworks: ['no', 'static', 'dynamic']
engine: ['hermes', 'jsc']
include:
- platform: ios
rn-version: '0.73.2'
runs-on: macos-14 # uses m1 https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
runtime: 'latest'
device: 'iPhone 14'
- platform: ios
rn-version: '0.65.3'
runs-on: macos-12
runtime: 'latest'
device: 'iPhone 14'
- platform: android
runs-on: ubuntu-latest
exclude:
# exclude JSC for new RN versions (keeping the matrix manageable)
- rn-version: '0.73.2'
engine: 'jsc'
# exclude all rn versions lower than 0.70.0 for new architecture
- rn-version: '0.65.3'
rn-architecture: 'new'
# exlude old rn version for use frameworks builds (to minimalize the matrix)
- rn-version: '0.65.3'
platform: 'ios'
ios-use-frameworks: 'static'
- rn-version: '0.65.3'
platform: 'ios'
ios-use-frameworks: 'dynamic'
# use frameworks is ios only feature
- platform: 'android'
ios-use-frameworks: 'static'
- platform: 'android'
ios-use-frameworks: 'dynamic'
# exclude new rn architecture and dynamic frameworks
- rn-architecture: 'new'
ios-use-frameworks: 'dynamic'
steps:
- uses: actions/checkout@v4
- name: Sentry Release
run: |
SENTRY_RELEASE_CANDIDATE=$(echo 'e2e/${{ github.ref }}' | perl -pe 's/\//-/g')
echo "SENTRY_RELEASE=$SENTRY_RELEASE_CANDIDATE" >> $GITHUB_ENV
- name: Sentry Dist
run: |
SENTRY_DIST_CANDIDATE=${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}-${GITHUB_SHA:0:8}
echo "SENTRY_DIST=$SENTRY_DIST_CANDIDATE" >> $GITHUB_ENV
- name: Sentry Envs
run: |
echo "SENTRY_RELEASE=$SENTRY_RELEASE"
echo "SENTRY_DIST=$SENTRY_DIST"
- run: sudo xcode-select -s /Applications/Xcode_14.2.app/Contents/Developer
if: ${{ matrix.platform == 'ios' && matrix.rn-version == '0.65.3' }}
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/setup-java@v4
if: ${{ matrix.rn-version == '0.65.3' }}
with:
java-version: '11'
distribution: 'adopt'
- uses: actions/setup-java@v4
if: ${{ matrix.rn-version != '0.65.3' }}
with:
java-version: '17'
distribution: 'adopt'
- name: Gradle cache
uses: gradle/gradle-build-action@v3
- name: Setup Global Tools
run: |
yarn global add yalc semver
- name: Setup Global Xcode Tools
if: ${{ matrix.platform == 'ios' }}
run: which xcbeautify || brew install xcbeautify
- name: NPM cache SDK
uses: actions/cache@v4
id: deps-cache
with:
path: node_modules
key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('yarn.lock') }}
- name: NPM cache E2E Tests Library
uses: actions/cache@v4
id: deps-cache-e2e-library
with:
path: test/e2e/node_modules
key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('test/e2e/yarn.lock') }}
- name: Install SDK JS Dependencies
if: ${{ steps.deps-cache.outputs['cache-hit'] != 'true' }}
run: yarn install
- name: Install E2E Tests Library JS Dependencies
if: steps.deps-cache.outputs['deps-cache-e2e-library'] != 'true'
working-directory: test/e2e
run: yarn install
- name: Build SDK
run: yarn build
- name: Build E2E Tests Library
working-directory: test/e2e
run: yarn build
- name: Package SDK
run: yalc publish
- uses: actions/setup-node@v4
if: ${{ matrix.rn-version == '0.65.3' }}
with:
node-version: 16
- name: Download Plain RN ${{ matrix.rn-version }} App
working-directory: test/react-native/versions
run: git clone $RN_DIFF_REPOSITORY --branch release/${{ matrix.rn-version }} --single-branch ${{ matrix.rn-version }}
- name: Add SDK to App
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
run: yalc add @sentry/react-native
- name: Install App JS Dependencies
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
run: yarn install
- name: Add E2E Tests Library to App
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
run: yarn add ../../../../e2e
- uses: ruby/setup-ruby@v1
if: ${{ matrix.platform == 'ios' }}
with:
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
ruby-version: '3.3.0' # based on what is used in the sample
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 1 # cache the installed gems
- run: gem install cocoapods -v 1.15.2 # fixes Hermes pod install https://github.com/CocoaPods/CocoaPods/issues/12226#issuecomment-1930604302
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
if: ${{ matrix.platform == 'ios' }}
- name: Install App Pods
if: ${{ matrix.platform == 'ios' }}
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp/ios
run: |
../../../../rn.patch.podfile.js --pod-file Podfile --engine ${{ matrix.engine }}
[[ "${{ matrix.ios-use-frameworks }}" == "static" ]] && export USE_FRAMEWORKS=static && export NO_FLIPPER=1
[[ "${{ matrix.ios-use-frameworks }}" == "dynamic" ]] && export USE_FRAMEWORKS=dynamic && export NO_FLIPPER=1
[[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
[[ "${{ matrix.rn-architecture }}" == "new" ]] && ENABLE_NEW_ARCH=1 || ENABLE_NEW_ARCH=0
[[ "${{ matrix.rn-version }}" == "0.65.3" ]] && POD_INSTALL_COMMNAND="pod install" || POD_INSTALL_COMMNAND="bundle exec pod install"
echo "ENABLE_PROD=$ENABLE_PROD"
echo "ENABLE_NEW_ARCH=$ENABLE_NEW_ARCH"
echo "USE_FRAMEWORKS=$USE_FRAMEWORKS"
PRODUCTION=$ENABLE_PROD RCT_NEW_ARCH_ENABLED=$ENABLE_NEW_ARCH $POD_INSTALL_COMMNAND
cat Podfile.lock | grep $RN_SENTRY_POD_NAME
- name: Patch App RN
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
run: |
patch --verbose --strip=0 --force --ignore-whitespace --fuzz 4 < ../../../rn.patch
../../../rn.patch.app.js --app .
../../../rn.patch.metro.config.js --path metro.config.js
- name: Patch Android App RN
if: ${{ matrix.platform == 'android' }}
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
run: |
../../../rn.patch.gradle.properties.js --gradle-properties android/gradle.properties --engine ${{ matrix.engine }}
../../../rn.patch.app.build.gradle.js --app-build-gradle android/app/build.gradle
- name: Patch iOS App RN
if: ${{ matrix.platform == 'ios' }}
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp
run: |
../../../rn.patch.xcode.js \
--project ios/RnDiffApp.xcodeproj/project.pbxproj \
--rn-version '${{ matrix.rn-version }}'
# This prevents modules resolution from outside of the RN Test App projects
# during the native app build
- name: Clean SDK node_modules
run: rm -rf node_modules
- name: Build Android App
if: ${{ matrix.platform == 'android' }}
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp/android
run: |
if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
echo 'New Architecture enabled'
fi
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
echo "Building $CONFIG"
./gradlew ":app:assemble$CONFIG" -PreactNativeArchitectures=x86
- name: Build iOS App
if: ${{ matrix.platform == 'ios' }}
working-directory: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp/ios
run: |
[[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
echo "Building $CONFIG"
mkdir -p "DerivedData"
derivedData="$(cd "DerivedData" ; pwd -P)"
set -o pipefail && xcodebuild \
-workspace RnDiffApp.xcworkspace \
-configuration "$CONFIG" \
-scheme RnDiffApp \
-destination 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}' \
ONLY_ACTIVE_ARCH=yes \
-derivedDataPath "$derivedData" \
build \
| tee xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output
- name: Archive Android APK
if: matrix.platform == 'android' && matrix.build-type == 'production'
run: |
BUILD_PATH=test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp/android/app/build/outputs/apk/release
BUILD_NAME=app-release.apk
tar -cvf apk.tar -C $BUILD_PATH $BUILD_NAME
- name: Archive iOS APP
if: matrix.platform == 'ios' && matrix.build-type == 'production'
run: |
BUILD_PATH=test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp/ios/DerivedData/Build/Products/Release-iphonesimulator
BUILD_NAME=RnDiffApp.app
tar -cvf app.tar -C $BUILD_PATH $BUILD_NAME
- name: Upload App APK
if: matrix.platform == 'android' && matrix.build-type == 'production'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}-app-package
path: apk.tar
retention-days: 1
- name: Upload App APP
if: matrix.platform == 'ios' && matrix.build-type == 'production'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}-app-package
path: app.tar
retention-days: 1
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: rn-build-logs-${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}
path: test/react-native/versions/${{ matrix.rn-version }}/RnDiffApp/ios/*.log
react-native-test:
name:
Test RN ${{ matrix.rn-version }} ${{ matrix.rn-architecture }} ${{ matrix.engine }} ${{ matrix.platform }} ${{
matrix.build-type }} ${{ matrix.ios-use-frameworks }}
needs: [react-native-build, diff_check]
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false # keeps matrix running if one fails
matrix:
rn-version: ['0.65.3', '0.73.2']
rn-architecture: ['legacy', 'new']
platform: ['android', 'ios']
build-type: ['production']
ios-use-frameworks: ['no'] # test only no framworks
engine: ['hermes', 'jsc']
include:
- platform: ios
rn-version: '0.73.2'
runs-on: macos-14 # uses m1 https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
runtime: 'latest'
device: 'iPhone 14'
- platform: ios
rn-version: '0.65.3'
runs-on: macos-latest
runtime: 'latest'
device: 'iPhone 14'
- platform: android
runs-on: ubuntu-latest
exclude:
# exclude all rn versions lower than 0.70.0 for new architecture
- rn-version: '0.65.3'
rn-architecture: 'new'
# e2e test only the default combinations
- rn-version: '0.65.3'
engine: 'hermes'
- rn-version: '0.73.2'
engine: 'jsc'
# E2E timeout due to a race condition https://github.com/facebook/react-native/issues/42123#issuecomment-1881203719
- rn-version: '0.73.2'
platform: 'ios'
rn-architecture: 'new'
env:
PLATFORM: ${{ matrix.platform }}
DEVICE: ${{ matrix.device }}
steps:
- uses: actions/checkout@v4
- name: Setup Global Xcode Tools
if: ${{ matrix.platform == 'ios' }}
run: which xcbeautify || brew install xcbeautify
- name: Download App Package
if: matrix.build-type == 'production'
uses: actions/download-artifact@v4
with:
name: ${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}-app-package
path: test/e2e
- name: Extract App Package
working-directory: test/e2e
run: tar -xvf *.tar
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Gradle cache
uses: gradle/gradle-build-action@v3
- name: Setup KVM
if: ${{ matrix.platform == 'android' }}
shell: bash
run: |
# check if virtualization is supported...
sudo apt install -y --no-install-recommends cpu-checker coreutils && echo "CPUs=$(nproc --all)" && kvm-ok
# allow access to KVM to run the emulator
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: NPM cache E2E Tests Library
uses: actions/cache@v4
id: deps-cache-e2e-library
with:
path: test/e2e/node_modules
key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('test/e2e/yarn.lock') }}
- name: Install E2E Tests Library JS Dependencies
if: steps.deps-cache.outputs['deps-cache-e2e-library'] != 'true'
working-directory: test/e2e
run: yarn install
- name: Build iOS WebDriverAgent
if: matrix.platform == 'ios'
working-directory: test/e2e
run: |
mkdir -p "DerivedData"
derivedData="$(cd "DerivedData" ; pwd -P)"
set -o pipefail && xcodebuild \
-project node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj \
-scheme WebDriverAgentRunner \
GCC_TREAT_WARNINGS_AS_ERRORS=0 \
COMPILER_INDEX_STORE_ENABLE=NO \
-destination 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}' \
ONLY_ACTIVE_ARCH=yes \
-derivedDataPath "$derivedData" \
build \
| tee xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output
- name: Start Appium Server
working-directory: test/e2e
run: yarn run appium --log-timestamp --log-no-colors --log appium.${{ matrix.platform }}.log &
# Wait until the Appium server starts.
- name: Check Appium Server
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # [email protected]
with:
timeout_seconds: 60
max_attempts: 10
command: curl --output /dev/null --silent --head --fail http://127.0.0.1:4723/sessions
- name: Run tests on Android
if: ${{ matrix.platform == 'android' }}
env:
APPIUM_APP: ./app-release.apk
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # pin@v2
with:
working-directory: test/e2e
api-level: 30
force-avd-creation: false
disable-animations: true
disable-spellchecker: true
target: 'aosp_atd'
channel: canary # Necessary for ATDs
emulator-options: >
-no-window
-no-snapshot-save
-gpu swiftshader_indirect
-noaudio
-no-boot-anim
-camera-back none
-camera-front none
-timezone US/Pacific
script: |
# Collect logs
adb logcat '*:D' 2>&1 >adb.log &
adb devices -l
yarn test --verbose
- name: Run tests on iOS
if: ${{ matrix.platform == 'ios' }}
working-directory: test/e2e
env:
APPIUM_APP: ./RnDiffApp.app
APPIUM_DERIVED_DATA: DerivedData
run: yarn test --verbose
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.rn-version }}-${{ matrix.rn-architecture }}-${{ matrix.engine }}-${{ matrix.platform }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks }}-logs
path: |
test/e2e/*.log
test/e2e/*.png