Skip to content
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

[CI] Migrate to Circle 2.0 #14955

Closed
wants to merge 69 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
0dc5af0
Migrating to Circle 2
hramos Jul 11, 2017
0b6dde4
Add working_directory
hramos Jul 11, 2017
5df9b22
Update working directory
hramos Jul 11, 2017
2880d0c
Use actual home dir
hramos Jul 11, 2017
12a7898
Reverting to minimal configuration, running tests on Node.
hramos Sep 5, 2017
30cbad6
Add workflows
hramos Sep 5, 2017
2c2e469
Prefix npm with run:, remove node_modules caching for react-native, u…
hramos Sep 6, 2017
7bee3e8
Prefix cache keys
hramos Sep 6, 2017
6921bef
Android tests
hramos Sep 6, 2017
1bd2934
Fix parsing error
hramos Sep 6, 2017
9c9e0d8
Remove filter
hramos Sep 6, 2017
1b66576
Fix indentation
hramos Sep 6, 2017
317d5ff
Remove colon
hramos Sep 6, 2017
d5aee4b
Remove colon
hramos Sep 6, 2017
7fd9c66
Fix PATH env var
hramos Sep 6, 2017
13a6dce
Build JS bundle in Node image before running android tests
hramos Sep 6, 2017
02e853b
missing colon
hramos Sep 6, 2017
b406fd1
change buck installation directory, fix junit test collection
hramos Sep 6, 2017
64c78cd
Set up path in the same job that requires it
hramos Sep 6, 2017
589fa6d
Fix PATH export
hramos Sep 6, 2017
ff556a0
Configure PATH correctly, separate deps
hramos Sep 6, 2017
b98b541
Update PATH in $BASH_ENV, env var is already defined by Circle
hramos Sep 6, 2017
e94d620
Use Android image.
hramos Sep 6, 2017
e726213
Install SDK and launch AVD before moving on to other dependencies.
hramos Sep 6, 2017
8923297
Use sdkmanager and avdmanager to create the AVD
hramos Sep 6, 2017
1a76663
Force 32 bit emulator
hramos Sep 6, 2017
7436f18
Remove erroneous emulator64 command
hramos Sep 6, 2017
0be51c7
Add some buck deps, rename tests to Title Case.
hramos Sep 6, 2017
4946b33
remove python2
hramos Sep 6, 2017
12f9765
Build Android NDK
hramos Sep 7, 2017
ac0d8be
Download 32-bit NDK.
hramos Sep 7, 2017
9b90989
Add Qt dependencies.
hramos Sep 7, 2017
50d44ea
Download 32 and 64 bit NDKs
hramos Sep 7, 2017
e34949a
Install dependencies prior to configuring avd
hramos Sep 7, 2017
31b4e43
Switch back to circle-ci-android-setup-script.sh
hramos Sep 7, 2017
8532417
Update SDK install steps
hramos Sep 7, 2017
231fe88
Multiple threads, cache ndk
hramos Sep 7, 2017
73d3a0f
Build watchman, cache watchman
hramos Sep 7, 2017
6f725c7
Fix watchman cache step
hramos Sep 7, 2017
0cd9a6c
Enable Node 4 tests again
hramos Sep 7, 2017
863e3bc
Install Watchman, NDK in homedir, eliminating need to change permissi…
hramos Sep 7, 2017
93f1667
Add libtool dependency for Watchman
hramos Sep 7, 2017
f2a6e88
Add simple logs to make it clear what command we are waiting for
hramos Sep 7, 2017
45c8269
Update ndk cache key, shallow clone watchman, buck.
hramos Sep 7, 2017
b1d5b1a
Bump npm test to 2 workers
hramos Sep 7, 2017
c98e301
Bump cli test to 2 workers
hramos Sep 7, 2017
86be83c
Test and deploy website.
hramos Sep 7, 2017
cb42d2e
add pkg-config dep
hramos Sep 7, 2017
c12f3cc
update ndk cache key, fix yaml
hramos Sep 7, 2017
75479a5
Remove comments
hramos Sep 7, 2017
d0912ee
add missing website dep
hramos Sep 7, 2017
a50f837
update ndk cache key
hramos Sep 7, 2017
f1d7b9f
Comment out watchman step
hramos Sep 7, 2017
6f4b742
comment out website jobs
hramos Sep 7, 2017
177aabe
Move NDK back to /opt, move NDK install steps to Android Circle CI sc…
hramos Sep 7, 2017
033739f
Separate SDK installation and AVD creation, cache SDKs
hramos Sep 7, 2017
e54b3b5
eslint-bot, rename step
hramos Sep 7, 2017
f59f462
delay avd launch blocking
hramos Sep 7, 2017
5b13f5a
Explicitly install various Android packages, remove NDK 32-bit instal…
hramos Sep 8, 2017
8867db7
Bump docker image to API level 26
hramos Sep 8, 2017
09375d6
Slight logging change
hramos Sep 8, 2017
a938df0
Install NDK using sdkmanager
hramos Sep 8, 2017
db5daf7
Provide js bundle as an artifact, try old emulator command
hramos Sep 8, 2017
25c4b82
Restore 32-bit, 64-bit NDK manual installs
hramos Sep 8, 2017
447601f
yaml typo
hramos Sep 8, 2017
99e5c8f
[ci] Don't set /dev/shm as the temp dir in CircleCI
ide Sep 19, 2017
666958c
[ci] Comment out Android tests we know are failing
ide Sep 20, 2017
c4716ca
Uncomment tests
hramos Sep 20, 2017
bc964ac
fix yaml
hramos Sep 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
aliases:
- &restore-cache
keys:
- dependencies-{{ .Branch }}-{{ checksum "package.json" }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you prefix all the keys with v1- so we can easily manually bust the cache if we need to?

I'm also concerned about sharing node_modules caches across npm versions. In particular, Node 4 comes with npm 2 which doesn't have the deduping functionality of npm 3+.

What if we didn't cache node_modules for react-native but continued to cache them for the website and danger (where we use just a single Node + npm version)?

# Fallback in case checksum fails
- dependencies-{{ .Branch }}-
- &save-cache
paths:
- node_modules
key: dependencies-{{ .Branch }}-{{ checksum "package.json" }}

- &restore-cache-website
keys:
- website-dependencies-{{ .Branch }}-{{ checksum "website/package.json" }}
# Fallback in case checksum fails
- website-dependencies-{{ .Branch }}-
- &save-cache-website
paths:
- website/node_modules
key: website-dependencies-{{ .Branch }}-{{ checksum "website/package.json" }}

- &restore-cache-danger
keys:
- danger-dependencies-{{ .Branch }}-{{ checksum "danger/package.json" }}
# Fallback in case checksum fails
- danger-dependencies-{{ .Branch }}-
- &save-cache-danger
paths:
- danger/node_modules
key: danger-dependencies-{{ .Branch }}-{{ checksum "danger/package.json" }}

- &restore-cache-android
keys:
- android-dependencies-{{ .Branch }}-{{ checksum "ReactAndroid/build.gradle" }}
# Fallback in case checksum fails
- android-dependencies-{{ .Branch }}-
- &save-cache-android
paths:
- "ReactAndroid/build/downloads"
key: android-dependencies-{{ .Branch }}-{{ checksum "ReactAndroid/build.gradle" }}

- &restore-cache-buck
keys:
# TODO: Pick file to checksum against
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized with CircleCI caching we'd stop using the latest copy of Buck. If we want that, one thing we could do is commit a small file to RN that contains just a Git commit hash or Git tag of the Buck repo. We'd check out just that commit and cache it. That way we intentionally don't use the latest copy of Buck and also consistently use the same version, not at the whim of CircleCI's caching behavior.

If we do want to use the latest copy of Buck, we could create a shallow clone of its Git repo (to avoid downloading 500MB) and build it each time.

- buck-dependencies-{{ .Branch }}
- &save-cache-buck
paths:
- "/home/ubuntu/buck"
key: buck-dependencies-{{ .Branch }}


version: 2
jobs:
test-node-8:
working_directory: ~/react-native
docker:
- image: circleci/node:8.1.4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of just making this be circleci/node:8 so we naturally test the latest version of 8.x (but give up some reproduceability)?

steps:
- checkout
- restore-cache: *restore-cache
- npm install
Copy link
Contributor

@ide ide Sep 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need this to be behind the run: key. Also might want to add --no-package-lock since npm 5 adds package-lock.json.

- save-cache: *save-cache
- run: |
npm run lint
npm run flow -- check
npm test -- --maxWorkers=1
test-node-6:
working_directory: ~/react-native
docker:
- image: circleci/node:6.11.0
steps:
- checkout
- restore-cache: *restore-cache
- npm install
- save-cache: *save-cache
- run: |
npm run lint
npm run flow -- check
npm test -- --maxWorkers=1
test-node-4:
working_directory: ~/jest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be ~/react-native like the others?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should! I followed Jest's as a starting point, and I overlooked this line.

docker:
- image: circleci/node:4.8.4
steps:
- checkout
- restore-cache: *restore-cache
- npm install
- save-cache: *save-cache
- run: |
npm run lint
npm run flow -- check
npm test -- --maxWorkers=1

# Workflows enables us to run multiple jobs in parallel
workflows:
version: 2
build-and-deploy:
jobs:
- test-node-8
- test-node-6
- test-node-4
113 changes: 0 additions & 113 deletions circle.yml

This file was deleted.