@@ -88,8 +88,7 @@ aliases:
88
88
- &run-flow-checks
89
89
|
90
90
npm run flow -- check
91
-
92
-
91
+
93
92
- &filter-only-master-stable
94
93
branches :
95
94
only :
@@ -141,30 +140,34 @@ aliases:
141
140
buck build ReactAndroid/src/main/java/com/facebook/react
142
141
buck build ReactAndroid/src/main/java/com/facebook/react/shell
143
142
143
+ - &create-avd
144
+ name : Create Android Virtual Device
145
+ command : source scripts/circle-ci-android-setup.sh && createAVD
146
+
147
+ - &launch-avd
148
+ name : Launch Android Virtual Device in Background
149
+ command : source scripts/circle-ci-android-setup.sh && launchAVD
150
+ background : true
151
+
144
152
- &wait-for-avd
145
153
name : Wait for Android Virtual Device
146
154
command : source scripts/circle-ci-android-setup.sh && waitForAVD
147
155
148
- - &check-js-bundle
149
- name : Check for JavaScript Bundle
150
- command : |
151
- if [[ ! -e ReactAndroid/src/androidTest/assets/AndroidTestBundle.js ]]; then
152
- echo "JavaScript bundle missing, verify build-js-bundle step"; exit 1;
153
- else
154
- echo "JavaScript bundle found.";
155
- fi
156
+ - &build-js-bundle
157
+ name : Build JavaScript Bundle
158
+ command : node local-cli/cli.js bundle --max-workers 2 --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
156
159
157
160
- &compile-native-libs
158
161
name : Compile Native Libs for Unit and Integration Tests
159
162
command : ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=$BUILD_THREADS -Pcom.android.build.threadPoolSize=1
160
163
no_output_timeout : 6m
161
164
162
165
- &run-android-unit-tests
163
- name : Unit Tests
166
+ name : Run Unit Tests
164
167
command : buck test ReactAndroid/src/test/... --config build.threads=$BUILD_THREADS
165
168
166
- - &run-android-integration -tests
167
- name : Build and Install Test APK
169
+ - &run-android-instrumentation -tests
170
+ name : Run Instrumentation Tests
168
171
command : source scripts/circle-ci-android-setup.sh && NO_BUCKD=1 retry3 buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=$BUILD_THREADS
169
172
170
173
- &collect-android-test-results
@@ -330,26 +333,6 @@ jobs:
330
333
echo "Skipping deploy."
331
334
fi
332
335
333
- # Build JavaScript bundle for Android tests
334
- build-js-bundle :
335
- << : *defaults
336
- docker :
337
- - image : circleci/node:8
338
- steps :
339
- - checkout
340
- - restore-cache : *restore-node-cache
341
- - run : *install-node-dependencies
342
- - save-cache : *save-node-cache
343
- - run :
344
- name : Build JavaScript Bundle
345
- command : node local-cli/cli.js bundle --max-workers 2 --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
346
- - persist_to_workspace :
347
- root : ReactAndroid/src/androidTest/assets/
348
- paths :
349
- - AndroidTestBundle.js
350
- - store_artifacts :
351
- path : ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
352
-
353
336
# Runs unit tests tests on Android
354
337
test-android :
355
338
<< : *android_defaults
@@ -364,13 +347,8 @@ jobs:
364
347
- save-cache : *save-cache-android-packages
365
348
366
349
# Starting emulator in advance as it takes some time to boot.
367
- - run :
368
- name : Create Android Virtual Device
369
- command : source scripts/circle-ci-android-setup.sh && createAVD
370
- - run :
371
- name : Launch Android Virtual Device in Background
372
- command : source scripts/circle-ci-android-setup.sh && launchAVD
373
- background : true
350
+ - run : *create-avd
351
+ - run : *launch-avd
374
352
375
353
# Keep configuring Android dependencies while AVD boots up
376
354
- run : *create-ndk-directory
@@ -382,12 +360,6 @@ jobs:
382
360
- run : *install-buck
383
361
- save-cache : *save-cache-buck
384
362
385
- - run : *install-node
386
-
387
- - restore-cache : *restore-node-cache
388
- - run : *install-node-dependencies
389
- - save-cache : *save-node-cache
390
-
391
363
- run : buck fetch ReactAndroid/src/test/java/com/facebook/react/modules
392
364
- run : buck fetch ReactAndroid/src/main/java/com/facebook/react
393
365
- run : buck fetch ReactAndroid/src/main/java/com/facebook/react/shell
@@ -398,18 +370,19 @@ jobs:
398
370
- run : *build-android-app
399
371
- run : *compile-native-libs
400
372
401
- # The JavaScript Bundle is built as part of the build-js-bundle workflow,
402
- # and is required for instrumentation tests.
403
- - attach_workspace :
404
- at : ReactAndroid/src/androidTest/assets/
405
- - run : *check-js-bundle
373
+ # The JavaScript Bundle is required for instrumentation tests.
374
+ - run : *install-node
375
+ - restore-cache : *restore-node-cache
376
+ - run : *install-node-dependencies
377
+ - save-cache : *save-node-cache
378
+ - run : *build-js-bundle
406
379
407
380
# Wait for AVD to finish booting before running tests
408
381
- run : *wait-for-avd
409
382
410
383
# Tests
411
384
- run : *run-android-unit-tests
412
- - run : *run-android-integration -tests
385
+ - run : *run-android-instrumentation -tests
413
386
414
387
# post (always runs)
415
388
- run : *collect-android-test-results
@@ -474,11 +447,8 @@ workflows:
474
447
filters : *filter-ignore-gh-pages
475
448
476
449
# Test Android
477
- - build-js-bundle :
478
- filters : *filter-ignore-gh-pages
479
450
- test-android :
480
- requires :
481
- - build-js-bundle
451
+ filters : *filter-ignore-gh-pages
482
452
483
453
# Test iOS & tvOS
484
454
- test-objc-ios :
0 commit comments