forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
79 lines (72 loc) · 3.25 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
general:
branches:
ignore:
- gh-pages # list of branches to ignore
machine:
node:
version: 5.6.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:
# BUCK
- if [[ ! -e buck ]]; then git clone https://github.com/facebook/buck.git; fi
- cd buck && ant
- buck/bin/buck --version
- 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
- buck/bin/buck fetch ReactAndroid/src/test/...
- buck/bin/buck fetch ReactAndroid/src/androidTest/...
- source scripts/circle-ci-android-setup.sh && getAndroidSDK
- ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog
cache_directories:
- "ReactAndroid/build/downloads"
- "buck"
- "buck-out/bin"
- "website/node_modules"
override:
- npm install
- cd website && npm install
test:
pre:
# starting emulator in advance because it takes very long to boot
- $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
override:
# buck tests
- buck/bin/buck test ReactAndroid/src/test/... --config build.threads=1
- 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
# 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 tests on the emulator
- ./gradlew :ReactAndroid:connectedAndroidTest -PdisablePreDex --stacktrace --info:
timeout: 360
# testing docs generation is not broken
- cd website && node ./server/generate.js
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/ \;
deployment:
website:
branch: [/.*-stable/, /master/]
commands:
# generate docs website
- git config --global user.email "[email protected]"
- git config --global user.name "Website Deployment Script"
- echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" > ~/.netrc
- cd website && GIT_USER=reactjs-bot npm run gh-pages