-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Travis over to Circle #16354
Changes from 13 commits
1904114
1ef2f88
6299fb1
672d634
14e4e3f
19837d0
b97f1be
a17e8e5
b43e749
03f7aff
bf7dfde
a979ea8
684089d
4cf9f62
d751e1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
aliases: | ||
- &restore-cache | ||
- &restore-node-cache | ||
keys: | ||
- v1-dependencies-{{ .Branch }}-{{ checksum "package.json" }} | ||
# Fallback in case checksum fails | ||
- v1-dependencies-{{ .Branch }}- | ||
- &save-cache | ||
|
||
- &save-node-cache | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ .Branch }}-{{ checksum "package.json" }} | ||
|
@@ -14,6 +15,7 @@ aliases: | |
- v1-website-dependencies-{{ .Branch }}-{{ checksum "website/package.json" }} | ||
# Fallback in case checksum fails | ||
- v1-website-dependencies-{{ .Branch }}- | ||
|
||
- &save-cache-website | ||
paths: | ||
- website/node_modules | ||
|
@@ -24,6 +26,7 @@ aliases: | |
- v1-danger-dependencies-{{ .Branch }}-{{ checksum "danger/package.json" }} | ||
# Fallback in case checksum fails | ||
- v1-danger-dependencies-{{ .Branch }}- | ||
|
||
- &save-cache-danger | ||
paths: | ||
- danger/node_modules | ||
|
@@ -48,6 +51,7 @@ aliases: | |
- &restore-cache-ndk | ||
keys: | ||
- v1-android-ndk-r10e-32-64 | ||
|
||
- &save-cache-ndk | ||
paths: | ||
- /opt/ndk | ||
|
@@ -79,56 +83,116 @@ aliases: | |
- ~/watchman | ||
key: v1-watchman-v4.9.0 | ||
|
||
- &install-node-dependencies | ||
| | ||
npm config set spin=false | ||
npm config set progress=false | ||
npm install --no-package-lock | ||
|
||
- &run-node-tests | ||
| | ||
npm test -- --maxWorkers=2 | ||
npm run lint | ||
npm run flow -- check | ||
|
||
defaults: &defaults | ||
working_directory: ~/react-native | ||
|
||
version: 2 | ||
jobs: | ||
|
||
# Runs unit tests on Node 8 | ||
test-node-8: | ||
<<: *defaults | ||
docker: | ||
- image: circleci/node:8 | ||
steps: | ||
- checkout | ||
- run: npm install --no-package-lock | ||
- run: | | ||
npm test -- --maxWorkers=2 | ||
npm run lint | ||
npm run flow -- check | ||
# eslint - doesn't run on non-PR builds | ||
- run: | ||
name: Analyze Code | ||
command: | | ||
if [ -n "$CIRCLE_PR_NUMBER" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is re-added in @hramos PR as a separate job. |
||
npm install [email protected] | ||
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 | ||
echo "Skipping code analysis." | ||
fi | ||
- restore-cache: *restore-node-cache | ||
- run: *install-node-dependencies | ||
- save-cache: *save-node-cache | ||
- run: *run-node-tests | ||
|
||
# Runs unit tests on Node 6 | ||
test-node-6: | ||
<<: *defaults | ||
docker: | ||
- image: circleci/node:6.11.0 | ||
steps: | ||
- checkout | ||
- run: npm install | ||
- run: | | ||
npm test -- --maxWorkers=2 | ||
npm run lint | ||
npm run flow -- check | ||
- restore-cache: *restore-node-cache | ||
- run: *install-node-dependencies | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
- save-cache: *save-node-cache | ||
- run: *run-node-tests | ||
|
||
# Runs unit tests on Node 4 | ||
test-node-4: | ||
<<: *defaults | ||
docker: | ||
- image: circleci/node:4.8.4 | ||
steps: | ||
- checkout | ||
- run: npm install | ||
- run: | | ||
npm test -- --maxWorkers=2 | ||
npm run lint | ||
npm run flow -- check | ||
- restore-cache: *restore-node-cache | ||
- run: *install-node-dependencies | ||
- save-cache: *save-node-cache | ||
- run: *run-node-tests | ||
|
||
# Runs unit tests on iOS devices | ||
test-objc-ios: | ||
<<: *defaults | ||
macos: | ||
xcode: "9.0" | ||
dependencies: | ||
pre: | ||
- xcrun instruments -w "iPhone 5s (10.3.1)" || true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can do this separately from this PR, but at some point we should switch over to iOS 11.0 here, and tvOS 11.0 in |
||
steps: | ||
- checkout | ||
- restore-cache: *restore-node-cache | ||
- run: *install-node-dependencies | ||
- save-cache: *save-node-cache | ||
- run: ./scripts/objc-test-ios.sh | ||
|
||
# Runs unit tests on tvOS devices | ||
test-objc-tvos: | ||
<<: *defaults | ||
macos: | ||
xcode: "9.0" | ||
dependencies: | ||
pre: | ||
- xcrun instruments -w "Apple TV 1080p (10.0)" || true | ||
steps: | ||
- checkout | ||
- restore-cache: *restore-node-cache | ||
- run: *install-node-dependencies | ||
- save-cache: *save-node-cache | ||
- run: ./scripts/objc-test-tvos.sh | ||
|
||
# Runs end to end tests | ||
test-objc-e2e: | ||
<<: *defaults | ||
macos: | ||
xcode: "9.0" | ||
dependencies: | ||
pre: | ||
- xcrun instruments -w "iPhone 5s (10.3.1)" || true | ||
steps: | ||
- checkout | ||
- restore-cache: *restore-node-cache | ||
- run: *install-node-dependencies | ||
- save-cache: *save-node-cache | ||
- run: node ./scripts/run-ci-e2e-tests.js --ios --js --retries 3; | ||
|
||
# Checks podspec | ||
test-podspec: | ||
<<: *defaults | ||
macos: | ||
xcode: "9.0" | ||
steps: | ||
- checkout | ||
- restore-cache: *restore-node-cache | ||
- run: *install-node-dependencies | ||
- save-cache: *save-node-cache | ||
- run: ./scripts/process-podspecs.sh | ||
|
||
test-website: | ||
<<: *defaults | ||
|
@@ -181,7 +245,9 @@ jobs: | |
- image: circleci/node:8 | ||
steps: | ||
- checkout | ||
- run: npm install --no-package-lock | ||
- restore-cache: *restore-node-cache | ||
- run: *install-node-dependencies | ||
- save-cache: *save-node-cache | ||
- run: | ||
name: Build JavaScript Bundle | ||
command: node local-cli/cli.js bundle --max-workers 2 --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js | ||
|
@@ -258,7 +324,9 @@ jobs: | |
command: | | ||
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - | ||
sudo apt-get install -y nodejs | ||
- run: npm install | ||
- restore-cache: *restore-node-cache | ||
- run: *install-node-dependencies | ||
- save-cache: *save-node-cache | ||
# - restore-cache: *restore-cache-watchman | ||
# - run: | ||
# name: Install Watchman Dependencies | ||
|
@@ -349,12 +417,14 @@ jobs: | |
# Workflows enables us to run multiple jobs in parallel | ||
workflows: | ||
version: 2 | ||
|
||
test_node: | ||
jobs: | ||
- test-node-8 | ||
- test-node-6 | ||
# Node 4 tests are already failing on Circle 1.0 | ||
# - test-node-4 | ||
|
||
website: | ||
jobs: | ||
- test-website | ||
|
@@ -366,6 +436,7 @@ workflows: | |
only: | ||
- /.*-stable/ | ||
- master | ||
|
||
test_android: | ||
jobs: | ||
- build-js-bundle: | ||
|
@@ -375,3 +446,10 @@ workflows: | |
- test-android: | ||
requires: | ||
- build-js-bundle | ||
|
||
test_ios: | ||
jobs: | ||
- test-objc-ios | ||
- test-objc-tvos | ||
- test-podspec | ||
- test-objc-e2e |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can consolidate this into a single command:
npm install --no-package-lock --no-spin --no-progress
(Using the separate
npm config
commands is good when changing the preferences globally, but we're mostly runningnpm install
on separate images where the preference won't persist)