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 :
2016-05-23 12:08:28 +00:00
version : 6.2 .0
2015-12-24 18:39:19 +00:00
environment :
2016-03-18 15:09:20 +00:00
PATH : "~/$CIRCLE_PROJECT_REPONAME/gradle-2.9/bin:/home/ubuntu/buck/bin:$PATH"
2015-12-24 18:39:19 +00:00
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"'
2016-10-14 14:58:31 +00:00
java :
version : 'oraclejdk8'
2015-12-04 15:28:09 +00:00
dependencies :
2016-03-18 15:09:20 +00:00
override :
# BUCK and android
- if [[ ! -e /home/ubuntu/buck ]]; then git clone https://github.com/facebook/buck.git /home/ubuntu/buck; fi
- cd /home/ubuntu/buck && ant
- buck --version
2016-12-29 13:38:28 +00:00
- source scripts/circle-ci-android-setup.sh && getAndroidSDK
2016-03-18 15:09:20 +00:00
- buck fetch ReactAndroid/src/test/java/com/facebook/react/modules
- buck fetch ReactAndroid/src/main/java/com/facebook/react
- buck fetch ReactAndroid/src/main/java/com/facebook/react/shell
- buck fetch ReactAndroid/src/test/...
- buck fetch ReactAndroid/src/androidTest/...
2017-02-09 22:26:25 +00:00
- ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog :ReactAndroid:downloadJSCHeaders
2016-03-15 16:21:50 +00:00
# CIRCLE_NPM_TOKEN is in React Native project settings in Circle CI.
# It was generated for bestander user, easy to replace with anyone's else
- echo "//registry.npmjs.org/:_authToken=${CIRCLE_NPM_TOKEN}" > ~/.npmrc
2016-03-02 23:24:44 +00:00
- npm config set spin=false
- npm config set progress=false
2016-02-10 21:51:33 +00:00
- npm install
2016-03-18 15:09:20 +00:00
# for eslint bot
- npm install github@0.2.4
Adds Danger support
Summary:
Testing Danger support in CI. Continuation of #14964, which Circle stopped building.
Update your node modules first: `npm install`
`npm run danger pr https://github.com/facebook/react-native/pull/14951`
Verify output. This PR should trigger a WIP warning, as well as a package.json warning:
```
> react-native@1000.0.0 danger /Users/hramos/git/react-native
> node ./node_modules/.bin/danger "pr" "https://github.com/facebook/react-native/pull/14951"
{
fails: [],
warnings: [
{
message: ":construction_worker: Work In Progress - <i>Do not merge yet.</i>"
},
{
message: ":lock: Changes were made to package.json - <i>This will require a manual import. Once approved, a Facebook employee should import the PR, then run `yarn add` for any new packages.</i>"
}
],
messages: [],
markdowns: ["This PR requires attention from the facebook/react-native team."]
}
```
`npm run danger pr https://github.com/facebook/react-native/pull/14946`
Verify output. This PR should trigger a warning against the lack of a test plan (note that the PR does have a test plan, but it does not title it as such):
```
{
fails: [],
warnings: [
{
message: ":clipboard: Test Plan - <i>This PR appears to be missing a Test Plan</i>"
}
],
messages: [],
markdowns: []
}
```
`npm run danger pr https://github.com/facebook/react-native/pull/13186`
Should warn against a missing test plan:
```
{
fails: [],
warnings: [
{
message: ":clipboard: Test Plan - <i>This PR appears to be missing a Test Plan.</i>"
}
],
messages: [],
markdowns: [":page_facing_up: Thanks for your contribution to the docs!"]
}
```
If the author is able to issue bot commands, we reasonably assume that this is coming from an established core contributor. Their PRs will be flagged for expedited review:
`npm run danger pr https://github.com/facebook/react-native/pull/14895`
```
{
fails: [],
warnings: [
{
message: ":clipboard: Test Plan - <i>This PR appears to be missing a Test Plan.</i>"
}
],
messages: [],
markdowns: ["This PR has been submitted by a core contributor. Notifying facebook/react-native."]
}
```
Closes https://github.com/facebook/react-native/pull/15061
Differential Revision: D5436605
Pulled By: hramos
fbshipit-source-id: 4ba9e812387d8a69893dab537af9b6cd108753cf
2017-07-18 18:08:35 +00:00
# for website, danger
2016-02-15 21:07:36 +00:00
- cd website && npm install
Adds Danger support
Summary:
Testing Danger support in CI. Continuation of #14964, which Circle stopped building.
Update your node modules first: `npm install`
`npm run danger pr https://github.com/facebook/react-native/pull/14951`
Verify output. This PR should trigger a WIP warning, as well as a package.json warning:
```
> react-native@1000.0.0 danger /Users/hramos/git/react-native
> node ./node_modules/.bin/danger "pr" "https://github.com/facebook/react-native/pull/14951"
{
fails: [],
warnings: [
{
message: ":construction_worker: Work In Progress - <i>Do not merge yet.</i>"
},
{
message: ":lock: Changes were made to package.json - <i>This will require a manual import. Once approved, a Facebook employee should import the PR, then run `yarn add` for any new packages.</i>"
}
],
messages: [],
markdowns: ["This PR requires attention from the facebook/react-native team."]
}
```
`npm run danger pr https://github.com/facebook/react-native/pull/14946`
Verify output. This PR should trigger a warning against the lack of a test plan (note that the PR does have a test plan, but it does not title it as such):
```
{
fails: [],
warnings: [
{
message: ":clipboard: Test Plan - <i>This PR appears to be missing a Test Plan</i>"
}
],
messages: [],
markdowns: []
}
```
`npm run danger pr https://github.com/facebook/react-native/pull/13186`
Should warn against a missing test plan:
```
{
fails: [],
warnings: [
{
message: ":clipboard: Test Plan - <i>This PR appears to be missing a Test Plan.</i>"
}
],
messages: [],
markdowns: [":page_facing_up: Thanks for your contribution to the docs!"]
}
```
If the author is able to issue bot commands, we reasonably assume that this is coming from an established core contributor. Their PRs will be flagged for expedited review:
`npm run danger pr https://github.com/facebook/react-native/pull/14895`
```
{
fails: [],
warnings: [
{
message: ":clipboard: Test Plan - <i>This PR appears to be missing a Test Plan.</i>"
}
],
messages: [],
markdowns: ["This PR has been submitted by a core contributor. Notifying facebook/react-native."]
}
```
Closes https://github.com/facebook/react-native/pull/15061
Differential Revision: D5436605
Pulled By: hramos
fbshipit-source-id: 4ba9e812387d8a69893dab537af9b6cd108753cf
2017-07-18 18:08:35 +00:00
- cd danger && npm install
2016-03-18 15:09:20 +00:00
cache_directories :
- "ReactAndroid/build/downloads"
- "/home/ubuntu/buck"
- "website/node_modules"
- "node_modules"
Adds Danger support
Summary:
Testing Danger support in CI. Continuation of #14964, which Circle stopped building.
Update your node modules first: `npm install`
`npm run danger pr https://github.com/facebook/react-native/pull/14951`
Verify output. This PR should trigger a WIP warning, as well as a package.json warning:
```
> react-native@1000.0.0 danger /Users/hramos/git/react-native
> node ./node_modules/.bin/danger "pr" "https://github.com/facebook/react-native/pull/14951"
{
fails: [],
warnings: [
{
message: ":construction_worker: Work In Progress - <i>Do not merge yet.</i>"
},
{
message: ":lock: Changes were made to package.json - <i>This will require a manual import. Once approved, a Facebook employee should import the PR, then run `yarn add` for any new packages.</i>"
}
],
messages: [],
markdowns: ["This PR requires attention from the facebook/react-native team."]
}
```
`npm run danger pr https://github.com/facebook/react-native/pull/14946`
Verify output. This PR should trigger a warning against the lack of a test plan (note that the PR does have a test plan, but it does not title it as such):
```
{
fails: [],
warnings: [
{
message: ":clipboard: Test Plan - <i>This PR appears to be missing a Test Plan</i>"
}
],
messages: [],
markdowns: []
}
```
`npm run danger pr https://github.com/facebook/react-native/pull/13186`
Should warn against a missing test plan:
```
{
fails: [],
warnings: [
{
message: ":clipboard: Test Plan - <i>This PR appears to be missing a Test Plan.</i>"
}
],
messages: [],
markdowns: [":page_facing_up: Thanks for your contribution to the docs!"]
}
```
If the author is able to issue bot commands, we reasonably assume that this is coming from an established core contributor. Their PRs will be flagged for expedited review:
`npm run danger pr https://github.com/facebook/react-native/pull/14895`
```
{
fails: [],
warnings: [
{
message: ":clipboard: Test Plan - <i>This PR appears to be missing a Test Plan.</i>"
}
],
messages: [],
markdowns: ["This PR has been submitted by a core contributor. Notifying facebook/react-native."]
}
```
Closes https://github.com/facebook/react-native/pull/15061
Differential Revision: D5436605
Pulled By: hramos
fbshipit-source-id: 4ba9e812387d8a69893dab537af9b6cd108753cf
2017-07-18 18:08:35 +00:00
- "danger/node_modules"
2016-02-11 14:16:34 +00:00
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
- source scripts/circle-ci-android-setup.sh && waitForAVD
2016-02-11 14:16:34 +00:00
2015-12-04 15:28:09 +00:00
override :
Adds Danger support
Summary:
Testing Danger support in CI. Continuation of #14964, which Circle stopped building.
Update your node modules first: `npm install`
`npm run danger pr https://github.com/facebook/react-native/pull/14951`
Verify output. This PR should trigger a WIP warning, as well as a package.json warning:
```
> react-native@1000.0.0 danger /Users/hramos/git/react-native
> node ./node_modules/.bin/danger "pr" "https://github.com/facebook/react-native/pull/14951"
{
fails: [],
warnings: [
{
message: ":construction_worker: Work In Progress - <i>Do not merge yet.</i>"
},
{
message: ":lock: Changes were made to package.json - <i>This will require a manual import. Once approved, a Facebook employee should import the PR, then run `yarn add` for any new packages.</i>"
}
],
messages: [],
markdowns: ["This PR requires attention from the facebook/react-native team."]
}
```
`npm run danger pr https://github.com/facebook/react-native/pull/14946`
Verify output. This PR should trigger a warning against the lack of a test plan (note that the PR does have a test plan, but it does not title it as such):
```
{
fails: [],
warnings: [
{
message: ":clipboard: Test Plan - <i>This PR appears to be missing a Test Plan</i>"
}
],
messages: [],
markdowns: []
}
```
`npm run danger pr https://github.com/facebook/react-native/pull/13186`
Should warn against a missing test plan:
```
{
fails: [],
warnings: [
{
message: ":clipboard: Test Plan - <i>This PR appears to be missing a Test Plan.</i>"
}
],
messages: [],
markdowns: [":page_facing_up: Thanks for your contribution to the docs!"]
}
```
If the author is able to issue bot commands, we reasonably assume that this is coming from an established core contributor. Their PRs will be flagged for expedited review:
`npm run danger pr https://github.com/facebook/react-native/pull/14895`
```
{
fails: [],
warnings: [
{
message: ":clipboard: Test Plan - <i>This PR appears to be missing a Test Plan.</i>"
}
],
messages: [],
markdowns: ["This PR has been submitted by a core contributor. Notifying facebook/react-native."]
}
```
Closes https://github.com/facebook/react-native/pull/15061
Differential Revision: D5436605
Pulled By: hramos
fbshipit-source-id: 4ba9e812387d8a69893dab537af9b6cd108753cf
2017-07-18 18:08:35 +00:00
# Run Danger against PRs. This GitHub token grants public_repo access scope. The associated account has no privileged access to the React Native repo. The token must be split in this manner to avoid revocation by GitHub.
- cd danger && DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" npm run danger
# eslint bot. This GitHub token grants public_repo access scope. The token must be split in this manner to avoid revocation by GitHub.
2016-06-02 17:46:35 +00:00
- cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow --silent -- check --json) | GITHUB_TOKEN="af6ef0d15709bc91d""06a6217a5a826a226fb57b7" CI_USER=$CIRCLE_PROJECT_USERNAME CI_REPO=$CIRCLE_PROJECT_REPONAME PULL_REQUEST_NUMBER=$CIRCLE_PR_NUMBER node bots/code-analysis-bot.js
2017-07-10 19:01:50 +00:00
- npm run lint
2016-03-18 15:09:20 +00:00
# JS tests for dependencies installed with npm3
2016-06-02 17:46:35 +00:00
- npm run flow -- check
2016-03-18 15:09:20 +00:00
- npm test -- --maxWorkers=1
2016-03-02 14:55:09 +00:00
# build app
2016-03-18 15:09:20 +00:00
- buck build ReactAndroid/src/main/java/com/facebook/react
- buck build ReactAndroid/src/main/java/com/facebook/react/shell
2016-01-23 18:49:33 +00:00
2016-12-16 14:30:14 +00:00
# compile native libs with Gradle script, we need bridge for unit and
# integration tests
- ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=1 -Pcom.android.build.threadPoolSize=1 :
timeout : 360
2015-12-24 18:39:19 +00:00
# unit tests
2016-03-18 15:09:20 +00:00
- buck test ReactAndroid/src/test/... --config build.threads=1
2016-02-01 18:48:51 +00:00
2016-12-16 14:30:14 +00:00
# integration tests
2015-12-24 18:39:19 +00:00
# build JS bundle for instrumentation tests
2017-06-13 16:11:57 +00:00
- node local-cli/cli.js bundle --max-workers 1 --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
2017-09-05 18:19:45 +00:00
2016-03-02 14:55:09 +00:00
# build test APK
2017-09-05 18:19:45 +00:00
# Commented out due to test failures. Please uncomment the next line once these have been fixed. See Issue #15726.
# - buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=1
2016-03-02 14:55:09 +00:00
# run installed apk with tests
2017-03-31 17:05:03 +00:00
# - node ./scripts/run-android-ci-instrumentation-tests.js --retries 3 --path ./ReactAndroid/src/androidTest/java/com/facebook/react/tests --package com.facebook.react.tests
2016-03-02 14:55:09 +00:00
2016-04-13 15:18:49 +00:00
# Android e2e test
2017-04-21 20:44:33 +00:00
# disabled pending on https://our.intern.facebook.com/intern/tasks?t=16912142
# - source scripts/circle-ci-android-setup.sh && retry3 node ./scripts/run-ci-e2e-tests.js --android --js --retries 2
2016-03-04 17:22:53 +00:00
2016-09-14 21:16:35 +00:00
# testing docs generation
- cd website && npm test
2016-02-11 14:16:34 +00:00
- cd website && node ./server/generate.js
2017-06-03 21:01:42 +00:00
# if website can be built, deploy regardless of test failures
- if [[ ($CIRCLE_BRANCH =~ .*-stable || $CIRCLE_BRANCH == "master") && $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CI_PULL_REQUEST && -z $CIRCLE_PR_USERNAME ]]; then git config --global user.email "reactjs-bot@users.noreply.github.com" && 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; fi
2015-12-30 19:38:13 +00:00
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/ \;
2016-03-02 14:55:09 +00:00
# TODO circle does not understand Buck's report, maybe need to transform xml slightly
#- find . -type f -regex ".*/buck-out/gen/ReactAndroid/src/test/.*/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
2015-12-30 19:38:13 +00:00
2016-02-11 14:16:34 +00:00
deployment :
2016-03-15 16:21:50 +00:00
stable :
2016-02-11 14:16:34 +00:00
branch : [ /.*-stable/, /master/]
2017-06-03 21:01:42 +00:00
owner : facebook
2016-02-11 14:16:34 +00:00
commands :
2016-04-08 10:40:31 +00:00
- git config --global user.email "reactjs-bot@users.noreply.github.com"
2016-02-11 14:16:34 +00:00
- git config --global user.name "Website Deployment Script"
- echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" > ~/.netrc
2017-06-03 21:01:42 +00:00
# publish to npm
2016-03-15 16:21:50 +00:00
- node ./scripts/publish-npm.js
2017-02-22 23:08:41 +00:00
experimental :
notify :
branches :
only :
- master
- /.*-stable/