2016-01-05 11:44:53 +00:00
|
|
|
general:
|
|
|
|
branches:
|
|
|
|
ignore:
|
|
|
|
- gh-pages # list of branches to ignore
|
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"
|
2015-12-30 19:38:13 +00:00
|
|
|
ADB_INSTALL_TIMEOUT: 10
|
2015-12-24 18:39:19 +00:00
|
|
|
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx512m -XX:+HeapDumpOnOutOfMemoryError"'
|
2015-12-04 15:28:09 +00:00
|
|
|
|
|
|
|
dependencies:
|
|
|
|
pre:
|
2016-01-23 18:49:33 +00:00
|
|
|
# BUCK
|
|
|
|
- if [[ ! -e buck ]]; then git clone https://github.com/facebook/buck.git; fi
|
|
|
|
- cd buck && ant
|
|
|
|
- buck/bin/buck --version
|
2016-01-27 16:51:54 +00:00
|
|
|
- buck/bin/buck fetch ReactAndroid/src/test/java/com/facebook/react/modules
|
|
|
|
- buck/bin/buck fetch ReactAndroid/src/main/java/com/facebook/react
|
|
|
|
- buck/bin/buck fetch ReactAndroid/src/main/java/com/facebook/react/shell
|
2016-01-27 15:26:55 +00:00
|
|
|
- buck/bin/buck fetch ReactAndroid/src/test/...
|
|
|
|
- buck/bin/buck fetch ReactAndroid/src/androidTest/...
|
2015-12-30 19:38:13 +00:00
|
|
|
# using npm@3 because of problems with shrink-wrapped optional deps installs on linux
|
2015-12-04 15:28:09 +00:00
|
|
|
- npm install -g npm@3.2
|
2015-12-30 19:38:13 +00:00
|
|
|
- source scripts/circle-ci-android-setup.sh && getAndroidSDK
|
|
|
|
- ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog
|
|
|
|
cache_directories:
|
|
|
|
- "ReactAndroid/build/downloads"
|
2016-01-27 15:26:55 +00:00
|
|
|
- "buck"
|
|
|
|
- "buck-out/bin"
|
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
|
2015-12-30 19:38:13 +00:00
|
|
|
- $ANDROID_HOME/tools/emulator -avd testAVD -no-skin -no-audio -no-window:
|
|
|
|
background: true
|
|
|
|
# assemble done separately because it requires quite a lot of memory and also gives time for emulator to load
|
|
|
|
- ./gradlew :ReactAndroid:assembleDebug -PdisablePreDex -Pjobs=1:
|
|
|
|
timeout: 360
|
|
|
|
- source scripts/circle-ci-android-setup.sh && waitForAVD
|
2015-12-04 15:28:09 +00:00
|
|
|
override:
|
2016-01-23 18:49:33 +00:00
|
|
|
# buck tests
|
2016-01-27 15:26:55 +00:00
|
|
|
- buck/bin/buck test ReactAndroid/src/test/...
|
2016-01-23 18:49:33 +00:00
|
|
|
- buck/bin/buck build ReactAndroid/src/main/java/com/facebook/react
|
|
|
|
- buck/bin/buck build ReactAndroid/src/main/java/com/facebook/react/shell
|
|
|
|
# temp, we can't run instrumentation tests yet
|
|
|
|
- buck/bin/buck build ReactAndroid/src/androidTest/java/com/facebook/react/tests
|
|
|
|
|
2015-12-24 18:39:19 +00:00
|
|
|
# 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
|
2015-12-24 18:39:19 +00:00
|
|
|
# run tests on the emulator
|
2015-12-30 19:38:13 +00:00
|
|
|
- ./gradlew :ReactAndroid:connectedAndroidTest -PdisablePreDex --stacktrace --info:
|
|
|
|
timeout: 360
|
|
|
|
post:
|
|
|
|
# copy test report for Circle CI to display
|
|
|
|
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
|
|
|
|
- find . -type f -regex ".*/build/test-results/debug/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
|
|
|
|
- find . -type f -regex ".*/outputs/androidTest-results/connected/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
|
|
|
|
|