-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[CI] Migrate to Circle 2.0 #14955
Changes from 6 commits
0dc5af0
0b6dde4
5df9b22
2880d0c
12a7898
30cbad6
2c2e469
7bee3e8
6921bef
1bd2934
9c9e0d8
1b66576
317d5ff
d5aee4b
7fd9c66
13a6dce
02e853b
b406fd1
64c78cd
589fa6d
ff556a0
b98b541
e94d620
e726213
8923297
1a76663
7436f18
0be51c7
4946b33
12f9765
ac0d8be
9b90989
50d44ea
e34949a
31b4e43
8532417
231fe88
73d3a0f
6f725c7
0cd9a6c
863e3bc
93f1667
f2a6e88
45c8269
b1d5b1a
c98e301
86be83c
cb42d2e
c12f3cc
75479a5
d0912ee
a50f837
f1d7b9f
6f4b742
177aabe
033739f
e54b3b5
f59f462
5b13f5a
8867db7
09375d6
a938df0
db5daf7
25c4b82
447601f
99e5c8f
666958c
c4716ca
bc964ac
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 |
---|---|---|
@@ -0,0 +1,101 @@ | ||
aliases: | ||
- &restore-cache | ||
keys: | ||
- dependencies-{{ .Branch }}-{{ checksum "package.json" }} | ||
# 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 | ||
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. 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 | ||
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. What do you think of just making this be |
||
steps: | ||
- checkout | ||
- restore-cache: *restore-cache | ||
- npm install | ||
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. Need this to be behind the |
||
- 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 | ||
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. Should this be ~/react-native like the others? 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. 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 |
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.
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)?