forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Closes facebook#4911 Reviewed By: svcscm Differential Revision: D2789142 Pulled By: androidtrunkagent fb-gh-sync-id: 9fd9520c27fc9acb7b139de6843a71ca3f918249
- Loading branch information
Showing
3 changed files
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,36 @@ | ||
machine: | ||
node: | ||
version: 5.1.0 | ||
environment: | ||
PATH: "~/$CIRCLE_PROJECT_REPONAME/gradle-2.9/bin:$PATH" | ||
TERM: "dumb" | ||
ADB_INSTALL_TIMEOUT: "10" | ||
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx512m -XX:+HeapDumpOnOutOfMemoryError"' | ||
|
||
dependencies: | ||
pre: | ||
- npm install -g [email protected] | ||
|
||
- wget "https://services.gradle.org/distributions/gradle-2.9-bin.zip"; unzip gradle-2.9-bin.zip | ||
test: | ||
pre: | ||
# starting emulator in advance because it takes very long to boot | ||
# the side effect is that we loose 1GB of RAM for all the following commands | ||
# if builds are running out of memory move the emulator start right before `wait-for-boot` | ||
- emulator -avd circleci-android22 -no-audio -no-window: | ||
background: true | ||
parallel: true | ||
override: | ||
# gradle is flaky in CI envs, found a solution here http://stackoverflow.com/questions/28409608/gradle-assembledebug-and-predexdebug-fail-with-circleci | ||
- TERM=dumb ./gradlew testDebugUnitTest -PpreDexEnable=false -Pcom.android.build.threadPoolSize=1 -Dorg.gradle.parallel=false -Dorg.gradle.jvmargs="-Xms512m -Xmx512m" -Dorg.gradle.daemon=false | ||
# build JS bundle | ||
# build ndkreactlib first because it consumes memory and downloads stuff | ||
- ./gradlew :ReactAndroid:buildReactNdkLib -PdisablePreDex -Pjobs=1 | ||
# unit tests | ||
- ./gradlew :ReactAndroid:testDebugUnitTest -PdisablePreDex | ||
# build JS bundle for instrumentation tests | ||
- node local-cli/cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/assets/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js | ||
# run instrumentation tests on device | ||
- TERM=dumb ./gradlew connectedCheck | ||
- circle-android wait-for-boot | ||
- sleep 5 | ||
# unlock the emulator screen | ||
- adb shell input keyevent 82 | ||
- sleep 5 | ||
# run tests on the emulator | ||
- ./gradlew :ReactAndroid:connectedAndroidTest -PdisablePreDex --stacktrace |