2015-12-04 15:28:09 +00:00
|
|
|
machine:
|
|
|
|
node:
|
|
|
|
version: 5.1.0
|
2015-12-24 18:39:19 +00:00
|
|
|
environment:
|
|
|
|
PATH: "~/$CIRCLE_PROJECT_REPONAME/gradle-2.9/bin:$PATH"
|
|
|
|
TERM: "dumb"
|
|
|
|
ADB_INSTALL_TIMEOUT: "10"
|
|
|
|
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx512m -XX:+HeapDumpOnOutOfMemoryError"'
|
2015-12-04 15:28:09 +00:00
|
|
|
|
|
|
|
dependencies:
|
|
|
|
pre:
|
|
|
|
- npm install -g npm@3.2
|
2015-12-24 18:39:19 +00:00
|
|
|
- wget "https://services.gradle.org/distributions/gradle-2.9-bin.zip"; unzip gradle-2.9-bin.zip
|
2015-12-04 15:28:09 +00:00
|
|
|
test:
|
2015-12-24 18:39:19 +00:00
|
|
|
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
|
2015-12-04 15:28:09 +00:00
|
|
|
override:
|
2015-12-24 18:39:19 +00:00
|
|
|
# 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
|
2015-12-21 17:37:27 +00:00
|
|
|
- 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
|
2015-12-24 18:39:19 +00:00
|
|
|
- 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
|