mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 21:53:30 +00:00
Updates CircleCI config
Summary: Contains changes needed for the `publish` step to be fixed. Closes https://github.com/facebook/react-native/pull/16913 Differential Revision: D6415385 Pulled By: hramos fbshipit-source-id: 1837aaf06e866a727bf77024eb5dc29d423a90a4
This commit is contained in:
parent
70c359000a
commit
088ff3a171
@ -52,6 +52,10 @@ aliases:
|
|||||||
keys:
|
keys:
|
||||||
- v1-android-ndk-{{ arch }}-r10e-32-64
|
- v1-android-ndk-{{ arch }}-r10e-32-64
|
||||||
|
|
||||||
|
- &install-ndk
|
||||||
|
|
|
||||||
|
source scripts/circle-ci-android-setup.sh && getAndroidNDK
|
||||||
|
|
||||||
- &save-cache-ndk
|
- &save-cache-ndk
|
||||||
paths:
|
paths:
|
||||||
- /opt/ndk
|
- /opt/ndk
|
||||||
@ -87,6 +91,19 @@ aliases:
|
|||||||
|
|
|
|
||||||
npm install --no-package-lock --no-spin --no-progress
|
npm install --no-package-lock --no-spin --no-progress
|
||||||
|
|
||||||
|
- &install-buck
|
||||||
|
|
|
||||||
|
if [[ ! -e ~/buck ]]; then
|
||||||
|
git clone https://github.com/facebook/buck.git ~/buck --branch v2017.09.04.02 --depth=1
|
||||||
|
fi
|
||||||
|
cd ~/buck && ant
|
||||||
|
buck --version
|
||||||
|
|
||||||
|
- &install-node
|
||||||
|
|
|
||||||
|
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
||||||
|
sudo apt-get install -y nodejs
|
||||||
|
|
||||||
- &run-node-tests
|
- &run-node-tests
|
||||||
|
|
|
|
||||||
npm test -- --maxWorkers=2
|
npm test -- --maxWorkers=2
|
||||||
@ -99,6 +116,11 @@ aliases:
|
|||||||
- /.*-stable/
|
- /.*-stable/
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
- &filter-only-stable
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- /.*-stable/
|
||||||
|
|
||||||
- &filter-ignore-gh-pages
|
- &filter-ignore-gh-pages
|
||||||
branches:
|
branches:
|
||||||
ignore: gh-pages
|
ignore: gh-pages
|
||||||
@ -110,9 +132,54 @@ aliases:
|
|||||||
- /.*-stable/
|
- /.*-stable/
|
||||||
- gh-pages
|
- gh-pages
|
||||||
|
|
||||||
|
- &create-ndk-directory
|
||||||
|
|
|
||||||
|
if [[ ! -e /opt/ndk ]]; then
|
||||||
|
sudo mkdir /opt/ndk
|
||||||
|
fi
|
||||||
|
sudo chown ${USER:=$(/usr/bin/id -run)}:$USER /opt/ndk
|
||||||
|
|
||||||
|
# CircleCI does not support interpolating env variables in the environment
|
||||||
|
# https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables
|
||||||
|
- &configure-android-path
|
||||||
|
|
|
||||||
|
echo 'export PATH=${ANDROID_NDK}:~/react-native/gradle-2.9/bin:~/buck/bin:$PATH' >> $BASH_ENV
|
||||||
|
source $BASH_ENV
|
||||||
|
|
||||||
|
- &install-android-packages
|
||||||
|
|
|
||||||
|
source scripts/circle-ci-android-setup.sh && getAndroidSDK
|
||||||
|
|
||||||
|
- &install-build-dependencies
|
||||||
|
|
|
||||||
|
sudo apt-get update -y
|
||||||
|
sudo apt-get install ant autoconf automake g++ gcc libqt5widgets5 lib32z1 lib32stdc++6 make maven python-dev python3-dev qml-module-qtquick-controls qtdeclarative5-dev file -y
|
||||||
|
|
||||||
|
- &install-android-app-dependencies
|
||||||
|
|
|
||||||
|
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/...
|
||||||
|
./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog :ReactAndroid:downloadJSCHeaders
|
||||||
|
|
||||||
defaults: &defaults
|
defaults: &defaults
|
||||||
working_directory: ~/react-native
|
working_directory: ~/react-native
|
||||||
|
|
||||||
|
android_defaults: &android_defaults
|
||||||
|
<<: *defaults
|
||||||
|
docker:
|
||||||
|
- image: circleci/android:api-26-alpha
|
||||||
|
resource_class: "large"
|
||||||
|
environment:
|
||||||
|
- TERM: "dumb"
|
||||||
|
- ADB_INSTALL_TIMEOUT: 10
|
||||||
|
- _JAVA_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
|
||||||
|
- GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError"'
|
||||||
|
- ANDROID_NDK: '/opt/ndk/android-ndk-r10e'
|
||||||
|
- BUILD_THREADS: 2
|
||||||
|
|
||||||
version: 2
|
version: 2
|
||||||
jobs:
|
jobs:
|
||||||
# Runs JavaScript tests on Node 8
|
# Runs JavaScript tests on Node 8
|
||||||
@ -208,6 +275,7 @@ jobs:
|
|||||||
- save-cache: *save-node-cache
|
- save-cache: *save-node-cache
|
||||||
- run: ./scripts/process-podspecs.sh
|
- run: ./scripts/process-podspecs.sh
|
||||||
|
|
||||||
|
# Tests website
|
||||||
test-website:
|
test-website:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
docker:
|
docker:
|
||||||
@ -228,6 +296,7 @@ jobs:
|
|||||||
name: Test Build Static Website
|
name: Test Build Static Website
|
||||||
command: cd website && node ./server/generate.js
|
command: cd website && node ./server/generate.js
|
||||||
|
|
||||||
|
# Deploys website
|
||||||
deploy-website:
|
deploy-website:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
docker:
|
docker:
|
||||||
@ -239,22 +308,57 @@ jobs:
|
|||||||
command: |
|
command: |
|
||||||
cd website
|
cd website
|
||||||
npm install --no-package-lock --no-spin --no-progress
|
npm install --no-package-lock --no-spin --no-progress
|
||||||
# The CIRCLE_PROJECT_USERNAME and CIRCLE_PR_USERNAME checks below
|
|
||||||
# ensure deploys only happen on projects owned by "facebook",
|
|
||||||
# never on a forked PR build.
|
|
||||||
- run:
|
- run:
|
||||||
name: Build and Deploy Static Website
|
name: Build and Deploy Static Website
|
||||||
command: |
|
command: |
|
||||||
if [[ $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CIRCLE_PR_USERNAME ]]; then
|
if [[ $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.email "reactjs-bot@users.noreply.github.com"
|
||||||
git config --global user.name "Website Deployment Script"
|
git config --global user.name "Website Deployment Script"
|
||||||
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" > ~/.netrc
|
echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" > ~/.netrc
|
||||||
echo "Deploying website..."
|
echo "Deploying website..."
|
||||||
cd website && GIT_USER=reactjs-bot npm run gh-pages
|
cd website && GIT_USER=reactjs-bot npm run gh-pages
|
||||||
elif [[ -n $CIRCLE_PR_USERNAME ]]; then
|
|
||||||
echo "Skipping website deploy, this is a forked PR build."
|
|
||||||
else
|
else
|
||||||
echo "Skipping website deploy."
|
echo "Skipping deploy."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Publishes new version onto npm
|
||||||
|
deploy:
|
||||||
|
<<: *android_defaults
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
|
||||||
|
# Configure Android dependencies
|
||||||
|
- run: *configure-android-path
|
||||||
|
- run: *install-build-dependencies
|
||||||
|
- restore-cache: *restore-cache-android-packages
|
||||||
|
- run: *install-android-packages
|
||||||
|
- save-cache: *save-cache-android-packages
|
||||||
|
- run: *create-ndk-directory
|
||||||
|
- restore-cache: *restore-cache-ndk
|
||||||
|
- run: *install-ndk
|
||||||
|
- save-cache: *save-cache-ndk
|
||||||
|
- restore-cache: *restore-cache-buck
|
||||||
|
- run: *install-buck
|
||||||
|
- save-cache: *save-cache-buck
|
||||||
|
- run: *install-node
|
||||||
|
- restore-cache: *restore-node-cache
|
||||||
|
- run: *install-node-dependencies
|
||||||
|
- save-cache: *save-node-cache
|
||||||
|
- restore-cache: *restore-cache-buck-downloads
|
||||||
|
- run: *install-android-app-dependencies
|
||||||
|
- save-cache: *save-cache-buck-downloads
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Publish React Native Package
|
||||||
|
command: |
|
||||||
|
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
|
||||||
|
echo "//registry.npmjs.org/:_authToken=${CIRCLE_NPM_TOKEN}" > ~/.npmrc
|
||||||
|
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
|
||||||
|
node ./scripts/publish-npm.js
|
||||||
|
else
|
||||||
|
echo "Skipping deploy."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Build JavaScript bundle for Android tests
|
# Build JavaScript bundle for Android tests
|
||||||
@ -279,116 +383,55 @@ jobs:
|
|||||||
|
|
||||||
# Runs unit tests tests on Android
|
# Runs unit tests tests on Android
|
||||||
test-android:
|
test-android:
|
||||||
<<: *defaults
|
<<: *android_defaults
|
||||||
docker:
|
|
||||||
- image: circleci/android:api-26-alpha
|
|
||||||
environment:
|
|
||||||
- TERM: "dumb"
|
|
||||||
- ADB_INSTALL_TIMEOUT: 10
|
|
||||||
- GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx512m -XX:+HeapDumpOnOutOfMemoryError"'
|
|
||||||
- ANDROID_NDK: '/opt/ndk/android-ndk-r10e'
|
|
||||||
- BUILD_THREADS: 2
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
# CircleCI does not support interpolating env variables in the environment: step above.
|
|
||||||
# https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables
|
# Configure Android dependencies
|
||||||
- run:
|
- run: *configure-android-path
|
||||||
name: Configure PATH
|
- run: *install-build-dependencies
|
||||||
command: |
|
|
||||||
echo 'export PATH=${ANDROID_NDK}:~/react-native/gradle-2.9/bin:~/buck/bin:$PATH' >> $BASH_ENV
|
|
||||||
source $BASH_ENV
|
|
||||||
# Configure dependencies
|
|
||||||
- run:
|
|
||||||
name: Install Build Dependencies
|
|
||||||
command: |
|
|
||||||
sudo apt-get update -y
|
|
||||||
sudo apt-get install ant autoconf automake g++ gcc libqt5widgets5 lib32z1 lib32stdc++6 make maven python-dev python3-dev qml-module-qtquick-controls qtdeclarative5-dev -y
|
|
||||||
- restore-cache: *restore-cache-android-packages
|
- restore-cache: *restore-cache-android-packages
|
||||||
- run:
|
- run: *install-android-packages
|
||||||
name: Install Android Packages
|
|
||||||
command: source scripts/circle-ci-android-setup.sh && getAndroidSDK
|
|
||||||
- save-cache: *save-cache-android-packages
|
- save-cache: *save-cache-android-packages
|
||||||
|
|
||||||
|
# Starting emulator in advance as it takes some time to boot.
|
||||||
- run:
|
- run:
|
||||||
name: Create Android Virtual Device
|
name: Create Android Virtual Device
|
||||||
command: source scripts/circle-ci-android-setup.sh && createAVD
|
command: source scripts/circle-ci-android-setup.sh && createAVD
|
||||||
# Starting emulator in advance as it takes some time to boot.
|
|
||||||
- run:
|
- run:
|
||||||
name: Launch Android Virtual Device in Background
|
name: Launch Android Virtual Device in Background
|
||||||
command: source scripts/circle-ci-android-setup.sh && launchAVD
|
command: source scripts/circle-ci-android-setup.sh && launchAVD
|
||||||
background: true
|
background: true
|
||||||
# Continue configuring dependencies while AVD boots.
|
|
||||||
- run:
|
# Keep configuring Android dependencies while AVD boots up
|
||||||
name: Create Android NDK Directory
|
- run: *create-ndk-directory
|
||||||
command: |
|
|
||||||
if [[ ! -e /opt/ndk ]]; then
|
|
||||||
sudo mkdir /opt/ndk
|
|
||||||
fi
|
|
||||||
sudo chown ${USER:=$(/usr/bin/id -run)}:$USER /opt/ndk
|
|
||||||
- restore-cache: *restore-cache-ndk
|
- restore-cache: *restore-cache-ndk
|
||||||
- run:
|
- run: *install-ndk
|
||||||
name: Install Android NDK
|
|
||||||
command: source scripts/circle-ci-android-setup.sh && getAndroidNDK
|
|
||||||
- save-cache: *save-cache-ndk
|
- save-cache: *save-cache-ndk
|
||||||
- restore-cache: *restore-cache-buck
|
- restore-cache: *restore-cache-buck
|
||||||
- run:
|
- run: *install-buck
|
||||||
name: Install Buck
|
|
||||||
command: |
|
|
||||||
if [[ ! -e ~/buck ]]; then
|
|
||||||
git clone https://github.com/facebook/buck.git ~/buck --branch v2017.11.16.01 --depth=1
|
|
||||||
fi
|
|
||||||
cd ~/buck && ant
|
|
||||||
buck --version
|
|
||||||
- save-cache: *save-cache-buck
|
- save-cache: *save-cache-buck
|
||||||
- run:
|
- run: *install-node
|
||||||
name: Install Node
|
|
||||||
command: |
|
|
||||||
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
|
||||||
sudo apt-get install -y nodejs
|
|
||||||
- restore-cache: *restore-node-cache
|
- restore-cache: *restore-node-cache
|
||||||
- run: *install-node-dependencies
|
- run: *install-node-dependencies
|
||||||
- save-cache: *save-node-cache
|
- save-cache: *save-node-cache
|
||||||
# TODO: Install and use watchman to speed up builds
|
|
||||||
# - restore-cache: *restore-cache-watchman
|
|
||||||
# - run:
|
|
||||||
# name: Install Watchman Dependencies
|
|
||||||
# command: |
|
|
||||||
# sudo apt-get update -y
|
|
||||||
# sudo apt-get install libtool pkg-config -y
|
|
||||||
# - run:
|
|
||||||
# name: Install Watchman
|
|
||||||
# command: |
|
|
||||||
# if [[ ! -e ~/watchman ]]; then
|
|
||||||
# mkdir ~/watchman
|
|
||||||
# git clone https://github.com/facebook/watchman.git ~/watchman --branch v4.9.0 --depth=1
|
|
||||||
# cd ~/watchman
|
|
||||||
# ./autogen.sh
|
|
||||||
# ./configure
|
|
||||||
# make
|
|
||||||
# fi
|
|
||||||
# cd ~/watchman
|
|
||||||
# sudo make install
|
|
||||||
# - save-cache: *save-cache-watchman
|
|
||||||
- restore-cache: *restore-cache-buck-downloads
|
- restore-cache: *restore-cache-buck-downloads
|
||||||
- run:
|
- run: *install-android-app-dependencies
|
||||||
name: Download Android App Dependencies
|
|
||||||
command: |
|
|
||||||
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/...
|
|
||||||
./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog :ReactAndroid:downloadJSCHeaders
|
|
||||||
- save-cache: *save-cache-buck-downloads
|
- save-cache: *save-cache-buck-downloads
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Build Android App
|
name: Build Android App
|
||||||
command: |
|
command: |
|
||||||
buck build ReactAndroid/src/main/java/com/facebook/react
|
buck build ReactAndroid/src/main/java/com/facebook/react
|
||||||
buck build ReactAndroid/src/main/java/com/facebook/react/shell
|
buck build ReactAndroid/src/main/java/com/facebook/react/shell
|
||||||
# Wait for AVD to finish booting before running tests
|
|
||||||
|
# Wait for AVD to finish booting before running tests
|
||||||
- run:
|
- run:
|
||||||
name: Wait for Android Virtual Device
|
name: Wait for Android Virtual Device
|
||||||
command: source scripts/circle-ci-android-setup.sh && waitForAVD
|
command: source scripts/circle-ci-android-setup.sh && waitForAVD
|
||||||
# The JavaScript Bundle is built as part of the build-js-bundle workflow, and is required for instrumentation tests.
|
|
||||||
|
# The JavaScript Bundle is built as part of the build-js-bundle workflow,
|
||||||
|
# and is required for instrumentation tests.
|
||||||
- attach_workspace:
|
- attach_workspace:
|
||||||
at: ReactAndroid/src/androidTest/assets/
|
at: ReactAndroid/src/androidTest/assets/
|
||||||
- run:
|
- run:
|
||||||
@ -399,7 +442,8 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo "JavaScript bundle found.";
|
echo "JavaScript bundle found.";
|
||||||
fi
|
fi
|
||||||
# Tests
|
|
||||||
|
# Tests
|
||||||
- run:
|
- run:
|
||||||
name: Compile Native Libs for Unit and Integration Tests
|
name: Compile Native Libs for Unit and Integration Tests
|
||||||
command: ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=$BUILD_THREADS -Pcom.android.build.threadPoolSize=1
|
command: ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=$BUILD_THREADS -Pcom.android.build.threadPoolSize=1
|
||||||
@ -407,28 +451,19 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Unit Tests
|
name: Unit Tests
|
||||||
command: buck test ReactAndroid/src/test/... --config build.threads=$BUILD_THREADS
|
command: buck test ReactAndroid/src/test/... --config build.threads=$BUILD_THREADS
|
||||||
# Integration Tests
|
|
||||||
|
# Integration Tests
|
||||||
- run:
|
- run:
|
||||||
name: Build and Install Test APK
|
name: Build and Install Test APK
|
||||||
command: source scripts/circle-ci-android-setup.sh && NO_BUCKD=1 retry3 buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=$BUILD_THREADS
|
command: source scripts/circle-ci-android-setup.sh && NO_BUCKD=1 retry3 buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=$BUILD_THREADS
|
||||||
# TODO: Uncomment, test was already failing on Circle 1.0
|
|
||||||
# - run:
|
# post (always runs)
|
||||||
# name: Run Installed APK with Tests
|
|
||||||
# command: node ./scripts/run-android-ci-instrumentation-tests.js --retries 3 --path ./ReactAndroid/src/androidTest/java/com/facebook/react/tests --package com.facebook.react.tests
|
|
||||||
# TODO: Should be disabled, pending on https://our.intern.facebook.com/intern/tasks?t=16912142
|
|
||||||
# - run:
|
|
||||||
# name: Run Android End to End Tests
|
|
||||||
# command: source scripts/circle-ci-android-setup.sh && retry3 node ./scripts/run-ci-e2e-tests.js --android --js --retries 2
|
|
||||||
|
|
||||||
# post (always runs)
|
|
||||||
- run:
|
- run:
|
||||||
name: Collect Test Results
|
name: Collect Test Results
|
||||||
command: |
|
command: |
|
||||||
mkdir -p ~/junit/
|
mkdir -p ~/junit/
|
||||||
find . -type f -regex ".*/build/test-results/debug/.*xml" -exec cp {} ~/junit/ \;
|
find . -type f -regex ".*/build/test-results/debug/.*xml" -exec cp {} ~/junit/ \;
|
||||||
find . -type f -regex ".*/outputs/androidTest-results/connected/.*xml" -exec cp {} ~/junit/ \;
|
find . -type f -regex ".*/outputs/androidTest-results/connected/.*xml" -exec cp {} ~/junit/ \;
|
||||||
# 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 {} ~/junit/ \;
|
|
||||||
when: always
|
when: always
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ~/junit
|
path: ~/junit
|
||||||
@ -443,12 +478,10 @@ jobs:
|
|||||||
- checkout
|
- checkout
|
||||||
- restore-cache: *restore-cache-analysis
|
- restore-cache: *restore-cache-analysis
|
||||||
- run: *install-node-dependencies
|
- run: *install-node-dependencies
|
||||||
# The CIRCLE_PR_NUMBER checks below ensure
|
|
||||||
# code analysis only runs on forked PR builds.
|
|
||||||
- run:
|
- run:
|
||||||
name: Install Dependencies
|
name: Install Dependencies
|
||||||
command: |
|
command: |
|
||||||
if [ -n "$CIRCLE_PR_NUMBER" ]; then
|
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
|
||||||
npm install github@0.2.4
|
npm install github@0.2.4
|
||||||
cd danger
|
cd danger
|
||||||
npm install --no-package-lock --no-spin --no-progress
|
npm install --no-package-lock --no-spin --no-progress
|
||||||
@ -456,101 +489,69 @@ jobs:
|
|||||||
echo "Skipping dependency installation."
|
echo "Skipping dependency installation."
|
||||||
fi
|
fi
|
||||||
- save-cache: *save-cache-analysis
|
- save-cache: *save-cache-analysis
|
||||||
# Run Danger
|
|
||||||
- run:
|
- run:
|
||||||
name: Analyze Pull Request
|
name: Analyze Pull Request
|
||||||
command: |
|
command: |
|
||||||
if [ -n "$CIRCLE_PR_NUMBER" ]; then
|
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
|
||||||
cd danger && DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" npm run danger
|
cd danger && DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" npm run danger
|
||||||
else
|
else
|
||||||
echo "Skipping pull request analysis."
|
echo "Skipping pull request analysis."
|
||||||
fi
|
fi
|
||||||
when: always
|
when: always
|
||||||
# Run eslint
|
|
||||||
- run:
|
- run:
|
||||||
name: Analyze Code
|
name: Analyze Code
|
||||||
command: |
|
command: |
|
||||||
if [ -n "$CIRCLE_PR_NUMBER" && -n "$CIRCLE_PROJECT_USERNAME" && -n "$CIRCLE_PROJECT_REPONAME" ]; then
|
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
|
||||||
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
|
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
|
||||||
else
|
else
|
||||||
echo "Skipping code analysis."
|
echo "Skipping code analysis."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
publish-npm:
|
|
||||||
<<: *defaults
|
|
||||||
docker:
|
|
||||||
- image: circleci/node:8
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- run: *install-node-dependencies
|
|
||||||
- run:
|
|
||||||
name: Publish React Native Package
|
|
||||||
command: |
|
|
||||||
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
|
|
||||||
echo "//registry.npmjs.org/:_authToken=${CIRCLE_NPM_TOKEN}" > ~/.npmrc
|
|
||||||
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
|
|
||||||
node ./scripts/publish-npm.js
|
|
||||||
else
|
|
||||||
echo "Skipping publication."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Workflows enables us to run multiple jobs in parallel
|
# Workflows enables us to run multiple jobs in parallel
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
test_node:
|
build:
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
# Test Javascript on Node 8 and 6
|
||||||
- test-js-node-8:
|
- test-js-node-8:
|
||||||
filters: *filter-ignore-gh-pages
|
filters: *filter-ignore-gh-pages
|
||||||
- test-js-node-6:
|
- test-js-node-6:
|
||||||
filters: *filter-ignore-gh-pages
|
filters: *filter-ignore-gh-pages
|
||||||
|
|
||||||
# TODO: Re-enable. Node 4 tests are already failing on Circle 1.0
|
|
||||||
# - test-js-node-4:
|
|
||||||
# filters: *filter-ignore-gh-pages
|
|
||||||
|
|
||||||
|
# Test Android
|
||||||
test_android:
|
|
||||||
jobs:
|
|
||||||
- build-js-bundle:
|
- build-js-bundle:
|
||||||
filters: *filter-ignore-gh-pages
|
filters: *filter-ignore-gh-pages
|
||||||
- test-android:
|
- test-android:
|
||||||
requires:
|
requires:
|
||||||
- build-js-bundle
|
- build-js-bundle
|
||||||
|
|
||||||
test_ios:
|
# Test iOS & tvOS
|
||||||
jobs:
|
|
||||||
- test-objc-ios:
|
- test-objc-ios:
|
||||||
filters: *filter-ignore-gh-pages
|
filters: *filter-ignore-gh-pages
|
||||||
- test-objc-tvos:
|
- test-objc-tvos:
|
||||||
filters: *filter-ignore-gh-pages
|
filters: *filter-ignore-gh-pages
|
||||||
- test-objc-e2e:
|
- test-objc-e2e:
|
||||||
filters: *filter-ignore-gh-pages
|
filters: *filter-ignore-gh-pages
|
||||||
# TODO: Re-enable. Podspec tests are already failing on Travis
|
|
||||||
# - test-podspec:
|
|
||||||
# filters: *filter-ignore-gh-pages
|
|
||||||
|
|
||||||
website:
|
# Test website
|
||||||
jobs:
|
|
||||||
- test-website:
|
- test-website:
|
||||||
filters: *filter-ignore-gh-pages
|
filters: *filter-ignore-gh-pages
|
||||||
- deploy-website:
|
|
||||||
requires:
|
# If we are on a stable branch, deploy to `npm`
|
||||||
- test-website
|
|
||||||
filters: *filter-only-master-stable
|
|
||||||
|
|
||||||
analyze:
|
|
||||||
jobs:
|
|
||||||
- analyze-pull-request:
|
|
||||||
filters: *filter-ignore-master-stable
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
jobs:
|
|
||||||
- hold:
|
- hold:
|
||||||
type: approval
|
type: approval
|
||||||
- publish-npm:
|
- deploy:
|
||||||
requires:
|
filters: *filter-only-stable
|
||||||
|
requires:
|
||||||
- hold
|
- hold
|
||||||
|
|
||||||
|
# If we are on a master / stable branch, deploy docs
|
||||||
|
- deploy-website:
|
||||||
filters: *filter-only-master-stable
|
filters: *filter-only-master-stable
|
||||||
|
requires:
|
||||||
|
- test-website
|
||||||
|
|
||||||
|
- analyze-pull-request:
|
||||||
|
filters: *filter-ignore-master-stable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user