Always run yarn after restoring modules cache (#15712)
Andrew Clark committed
May 22, 2019 at 13:33 UTC
1c0bdb710dc4d05a581b8f7b17990d1cdbe0a190
1 file changed
+49
-35
.circleci/config.yml
+49
-35
@@ -7,12 +7,18 @@ aliases:
7
- &environment
8
TZ: /usr/share/zoneinfo/America/Los_Angeles
9
10
- - &restore_node_modules
11
- name: Restore node_modules cache
12
- keys:
13
- - v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
14
- - v1-node-{{ arch }}-{{ .Branch }}-
15
- - v1-node-{{ arch }}-
10
+ - &restore_yarn_cache
11
+ restore_cache:
12
+ name: Restore node_modules cache
13
+ keys:
14
+ - v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
15
+ - v1-node-{{ arch }}-{{ .Branch }}-
16
+ - v1-node-{{ arch }}-
17
+ - &run_yarn
18
+ run:
19
+ name: Install Packages
20
+ command: yarn --frozen-lockfile
21
+
22
- &attach_workspace
23
at: build
24
@@ -23,18 +29,16 @@ jobs:
29
30
steps:
31
- checkout
26
- - restore_cache: *restore_node_modules
32
- run:
33
name: Nodejs Version
34
command: node --version
30
- - run:
31
- name: Install Packages
32
- command: yarn install --frozen-lockfile
35
+ - *restore_yarn_cache
36
+ - *run_yarn
37
- save_cache:
38
name: Save node_modules cache
39
key: v1-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
40
paths:
37
- - node_modules
41
+ - ~/.cache/yarn
42
43
lint:
44
docker: *docker
@@ -42,7 +46,8 @@ jobs:
46
47
steps:
48
- checkout
45
- - restore_cache: *restore_node_modules
49
+ - *restore_yarn_cache
50
+ - *run_yarn
51
- run: node ./scripts/prettier/index
52
- run: node ./scripts/tasks/eslint
53
- run: ./scripts/circleci/check_license.sh
@@ -55,53 +60,59 @@ jobs:
60
61
steps:
62
- checkout
58
- - restore_cache: *restore_node_modules
63
+ - *restore_yarn_cache
64
+ - *run_yarn
65
- run: node ./scripts/tasks/flow-ci
66
61
- test-source:
67
+ test_source:
68
docker: *docker
69
environment: *environment
70
71
steps:
72
- checkout
67
- - restore_cache: *restore_node_modules
73
+ - *restore_yarn_cache
74
+ - *run_yarn
75
- run: yarn test --maxWorkers=2
76
70
- test-source-persistent:
77
+ test_source_persistent:
78
docker: *docker
79
environment: *environment
80
81
steps:
82
- checkout
76
- - restore_cache: *restore_node_modules
83
+ - *restore_yarn_cache
84
+ - *run_yarn
85
- run: yarn test-persistent --maxWorkers=2
86
79
- test-source-prod:
87
+ test_source_prod:
88
docker: *docker
89
environment: *environment
90
91
steps:
92
- checkout
85
- - restore_cache: *restore_node_modules
93
+ - *restore_yarn_cache
94
+ - *run_yarn
95
- run: yarn test-prod --maxWorkers=2
96
88
- test-source-fire:
97
+ test_source_fire:
98
docker: *docker
99
environment: *environment
100
101
steps:
102
- checkout
94
- - restore_cache: *restore_node_modules
103
+ - *restore_yarn_cache
104
+ - *run_yarn
105
- run: yarn test-fire --maxWorkers=2
106
- run: yarn test-fire-prod --maxWorkers=2
107
98
- test-coverage:
108
+ test_coverage:
109
docker: *docker
110
environment: *environment
111
112
steps:
113
- checkout
104
- - restore_cache: *restore_node_modules
114
+ - *restore_yarn_cache
115
+ - *run_yarn
116
- run: ./scripts/circleci/test_coverage.sh
117
118
build:
@@ -109,7 +120,8 @@ jobs:
120
environment: *environment
121
steps:
122
- checkout
112
- - restore_cache: *restore_node_modules
123
+ - *restore_yarn_cache
124
+ - *run_yarn
125
- run: ./scripts/circleci/add_build_info_json.sh
126
- run: ./scripts/circleci/update_package_versions.sh
127
- run: ./scripts/circleci/build.sh
@@ -134,22 +146,24 @@ jobs:
146
- node_modules
147
- react-native
148
137
- test-build:
149
+ test_build:
150
docker: *docker
151
environment: *environment
152
steps:
153
- checkout
154
- attach_workspace: *attach_workspace
143
- - restore_cache: *restore_node_modules
155
+ - *restore_yarn_cache
156
+ - *run_yarn
157
- run: yarn test-build --maxWorkers=2
158
146
- test-build-prod:
159
+ test_build_prod:
160
docker: *docker
161
environment: *environment
162
steps:
163
- checkout
164
- attach_workspace: *attach_workspace
152
- - restore_cache: *restore_node_modules
165
+ - *restore_yarn_cache
166
+ - *run_yarn
167
- run: yarn test-build-prod --maxWorkers=2
168
169
workflows:
@@ -163,27 +177,27 @@ workflows:
177
- flow:
178
requires:
179
- setup
166
- - test-source:
180
+ - test_source:
181
requires:
182
- setup
169
- - test-source-prod:
183
+ - test_source_prod:
184
requires:
185
- setup
172
- - test-source-persistent:
186
+ - test_source_persistent:
187
requires:
188
- setup
175
- - test-source-fire:
189
+ - test_source_fire:
190
requires:
191
- setup
178
- - test-coverage:
192
+ - test_coverage:
193
requires:
194
- setup
195
- build:
196
requires:
197
- setup
184
- - test-build:
198
+ - test_build:
199
requires:
200
- build
187
- - test-build-prod:
201
+ - test_build_prod:
202
requires:
203
- build