@@ -112,7 +112,8 @@ aliases:
112
112
sudo apt-get install -y nodejs
113
113
114
114
- &create-ndk-directory
115
- |
115
+ name : Create Android NDK Directory
116
+ command : |
116
117
if [[ ! -e /opt/ndk ]]; then
117
118
sudo mkdir /opt/ndk
118
119
fi
@@ -121,16 +122,18 @@ aliases:
121
122
# CircleCI does not support interpolating env variables in the environment
122
123
# https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables
123
124
- &configure-android-path
124
- |
125
+ name : Configure Environment Variables
126
+ command : |
125
127
echo 'export PATH=${ANDROID_NDK}:~/react-native/gradle-2.9/bin:~/buck/bin:$PATH' >> $BASH_ENV
126
128
source $BASH_ENV
127
129
128
130
- &install-android-packages
129
131
|
130
132
source scripts/circle-ci-android-setup.sh && getAndroidSDK
131
133
132
- - &install-build-dependencies
133
- |
134
+ - &install-android-build-dependencies
135
+ name : Install Android Build Dependencies
136
+ command : |
134
137
sudo apt-get update -y
135
138
sudo apt-get install ant autoconf automake g++ gcc libqt5widgets5 lib32z1 lib32stdc++6 make maven python-dev python3-dev qml-module-qtquick-controls qtdeclarative5-dev file -y
136
139
@@ -171,7 +174,6 @@ aliases:
171
174
- &build-js-bundle
172
175
name : Build JavaScript Bundle
173
176
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
174
- when : always
175
177
176
178
- &compile-native-libs
177
179
name : Compile Native Libs for Unit and Integration Tests
@@ -184,7 +186,11 @@ aliases:
184
186
185
187
- &run-android-instrumentation-tests
186
188
name : Run Instrumentation Tests
187
- 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
189
+ command : |
190
+ if [[ ! -e ReactAndroid/src/androidTest/assets/AndroidTestBundle.js ]]; then
191
+ echo "JavaScript bundle missing, cannot run instrumentation tests. Verify build-js-bundle step completed successfully."; exit 1;
192
+ fi
193
+ 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
188
194
189
195
- &collect-android-test-results
190
196
name : Collect Test Results
@@ -254,6 +260,8 @@ jobs:
254
260
path : ~/reports/junit
255
261
- store_artifacts :
256
262
path : ~/reports/junit
263
+ - store_artifacts :
264
+ path : ~/react-native/yarn.lock
257
265
258
266
# Runs JavaScript tests on Node 8
259
267
js-node-8 :
@@ -387,7 +395,7 @@ jobs:
387
395
388
396
# Configure Android dependencies
389
397
- run : *configure-android-path
390
- - run : *install-build-dependencies
398
+ - run : *install-android- build-dependencies
391
399
- restore-cache : *restore-cache-android-packages
392
400
- run : *install-android-packages
393
401
- save-cache : *save-cache-android-packages
@@ -430,9 +438,9 @@ jobs:
430
438
- checkout
431
439
- run : *setup-artifacts
432
440
433
- # Configure Android dependencies
441
+ # Configure Android SDK and related dependencies
434
442
- run : *configure-android-path
435
- - run : *install-build-dependencies
443
+ - run : *install-android- build-dependencies
436
444
- restore-cache : *restore-cache-android-packages
437
445
- run : *install-android-packages
438
446
- save-cache : *save-cache-android-packages
@@ -442,11 +450,8 @@ jobs:
442
450
- run : *launch-avd
443
451
444
452
# Keep configuring Android dependencies while AVD boots up
445
- - run : *create-ndk-directory
446
- - restore-cache : *restore-cache-ndk
447
- - run : *install-ndk
448
- - save-cache : *save-cache-ndk
449
453
454
+ # Fetch dependencies using BUCK
450
455
- restore-cache : *restore-cache-buck
451
456
- run : *install-buck
452
457
- save-cache : *save-cache-buck
@@ -458,10 +463,17 @@ jobs:
458
463
- run : buck fetch ReactAndroid/src/androidTest/...
459
464
- run : ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog :ReactAndroid:downloadJSCHeaders
460
465
466
+ # Install Android NDK
467
+ - run : *create-ndk-directory
468
+ - restore-cache : *restore-cache-ndk
469
+ - run : *install-ndk
470
+ - save-cache : *save-cache-ndk
471
+
472
+ # Build and compile
461
473
- run : *build-android-app
462
474
- run : *compile-native-libs
463
475
464
- # The JavaScript Bundle is required for instrumentation tests.
476
+ # Build JavaScript Bundle for instrumentation tests
465
477
- run : *install-node
466
478
- run : *install-yarn
467
479
- restore-cache : *restore-yarn-cache
@@ -472,7 +484,7 @@ jobs:
472
484
# Wait for AVD to finish booting before running tests
473
485
- run : *wait-for-avd
474
486
475
- # Tests
487
+ # Test Suite
476
488
- run : *run-android-unit-tests
477
489
- run : *run-android-instrumentation-tests
478
490
@@ -568,4 +580,4 @@ workflows:
568
580
- hold
569
581
570
582
- analyze-pull-request :
571
- filters : *filter-ignore-master-stable
583
+ filters : *filter-ignore-master-stable
0 commit comments