-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
config.yml
350 lines (331 loc) · 8.51 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
version: 2
docker_defaults: &docker_defaults
docker:
- image: yarnpkg/dev:latest
working_directory: ~/project/yarn
macos_defaults: &macos_defaults
macos:
xcode: "11.0"
working_directory: ~/project/yarn
attach_workspace: &attach_workspace
attach_workspace:
at: ~/project
install_steps: &install_steps
steps:
- checkout
- *attach_workspace
- restore_cache:
name: Restore node_modules cache
keys:
# WARNING: add `{{ arch }}` into the keys below and separate the installation steps
# for Linux and macOS if you ever need platform-specific dependencies
# (anything using node-gyp etc.)
- v2-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
- v2-node-{{ .Branch }}-
- v2-node-
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save node_modules cache
key: v2-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules/
- persist_to_workspace:
root: ~/project
paths:
- yarn
test_build: &test_build
run:
name: Build Yarn for testing
command: |
if [ "$CIRCLE_BRANCH" == 'master' ]; then
./scripts/set-dev-version.js
fi;
yarn build
test_e2e_steps: &test_e2e_steps
steps:
- checkout
- run:
command: cd end_to_end_tests/data && ./run-ubuntu.sh
test_run: &test_run
run:
name: Tests
command: |
# Limit maxWorkers to 3 to avoid OOM on CircleCI
yarn test-only --maxWorkers 3
test_steps: &test_steps
steps:
- *attach_workspace
- *test_build
- *test_run
pkg_tests_install: &pkg_tests_install
run:
name: Install the dependencies for the pkg-tests testsuite
command: |
./bin/yarn --cwd packages/pkg-tests
pkg_tests_run: &pkg_tests_run
run:
name: Tests (pkg-tests testsuite)
command: |
./bin/yarn --cwd packages/pkg-tests jest yarn.test.js
pkg_tests: &pkg_tests
steps:
- *attach_workspace
- *test_build
- *pkg_tests_install
- *pkg_tests_run
default_filters: &default_filters
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/
jobs:
install:
<<: *docker_defaults
<<: *install_steps
lint:
<<: *docker_defaults
steps:
- *attach_workspace
- run:
name: Lint
command: yarn lint
build:
<<: *docker_defaults
steps:
- *attach_workspace
- run:
name: Build distribution
command: |
if [ "$CIRCLE_BRANCH" == 'master' ]; then
./scripts/set-dev-version.js
fi;
yarn build-dist
./scripts/build-deb.sh
- store_artifacts:
path: artifacts/
destination: yarnpkg
- persist_to_workspace:
root: ~/project
paths:
- yarn
test-pkg-tests-linux-node13:
<<: *docker_defaults
docker:
- image: node:13
<<: *pkg_tests
test-pkg-tests-linux-node12:
<<: *docker_defaults
docker:
- image: node:12
<<: *pkg_tests
test-pkg-tests-linux-node10:
<<: *docker_defaults
docker:
- image: node:10
<<: *pkg_tests
test-pkg-tests-linux-node8:
<<: *docker_defaults
<<: *pkg_tests
test-linux-node13:
<<: *docker_defaults
docker:
- image: node:13
<<: *test_steps
test-linux-node12:
<<: *docker_defaults
docker:
- image: node:12
<<: *test_steps
test-linux-node10:
<<: *docker_defaults
docker:
- image: node:10
<<: *test_steps
test-linux-node8:
<<: *docker_defaults
docker:
- image: node:8
<<: *test_steps
test-linux-node6:
<<: *docker_defaults
docker:
- image: node:6
<<: *test_steps
test-linux-node4:
<<: *docker_defaults
docker:
- image: node:4
<<: *test_steps
test-macos-node10:
<<: *macos_defaults
steps:
- run:
name: Install Node 10
command: |
brew uninstall --ignore-dependencies node
HOMEBREW_NO_AUTO_UPDATE=1 brew install node@10
brew link --overwrite --force node@10
[[ $(node --version) =~ ^v10\. ]]
- *attach_workspace
- *test_build
- *test_run
test-macos-node8:
<<: *macos_defaults
steps:
- run:
name: Install Node 8
command: |
brew uninstall --ignore-dependencies node
HOMEBREW_NO_AUTO_UPDATE=1 brew install node@8
brew link --overwrite --force node@8
[[ $(node --version) =~ ^v8\. ]]
- *attach_workspace
- *test_build
- *test_run
test-macos-node6:
<<: *macos_defaults
macos:
xcode: "9.0"
steps:
- run:
name: Install Node 6
command: |
brew uninstall --ignore-dependencies node
HOMEBREW_NO_AUTO_UPDATE=1 brew install node@6
brew link --overwrite --force node@6
[[ $(node --version) =~ ^v6\. ]]
- *attach_workspace
- *test_build
- *test_run
test-e2e-ubuntu1604:
<<: *docker_defaults
docker:
- image: ubuntu:16.04
<<: *test_e2e_steps
test-e2e-ubuntu1404:
<<: *docker_defaults
docker:
- image: ubuntu:14.04
<<: *test_e2e_steps
test-e2e-ubuntu1204:
<<: *docker_defaults
docker:
- image: ubuntu:12.04
<<: *test_e2e_steps
publish:
<<: *docker_defaults
steps:
- *attach_workspace
- run:
name: Publish
command: |
# Only NPM is handled here - All other release files are handled in a webhook.
if [ "${CIRCLE_PROJECT_USERNAME}" == "yarnpkg" ]; then
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
./scripts/update-npm.sh
fi
notify:
webhooks:
# Handles uploading stable/RC releases to GitHub
- url: https://nightly.yarnpkg.com/release_circleci
# Handles archiving all builds onto the nightly build site
- url: https://nightly.yarnpkg.com/archive_circleci
workflows:
version: 2
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- test-e2e-ubuntu1604
- test-e2e-ubuntu1404
- test-e2e-ubuntu1204
install-test-build-and-publish:
jobs:
- install:
filters: *default_filters
- lint:
filters: *default_filters
requires:
- install
- test-pkg-tests-linux-node13:
filters: *default_filters
requires:
- install
- test-pkg-tests-linux-node12:
filters: *default_filters
requires:
- install
- test-pkg-tests-linux-node10:
filters: *default_filters
requires:
- install
- test-pkg-tests-linux-node8:
filters: *default_filters
requires:
- install
- test-linux-node13:
filters: *default_filters
requires:
- install
- test-linux-node12:
filters: *default_filters
requires:
- install
- test-linux-node10:
filters: *default_filters
requires:
- install
- test-linux-node8:
filters: *default_filters
requires:
- install
- test-linux-node6:
filters: *default_filters
requires:
- install
- test-linux-node4:
filters: *default_filters
requires:
- install
- test-macos-node10:
filters: *default_filters
requires:
- install
- test-macos-node8:
filters: *default_filters
requires:
- install
- test-macos-node6:
filters: *default_filters
requires:
- install
- build:
filters: *default_filters
requires:
- install
- publish:
filters:
<<: *default_filters
branches:
ignore: /.*/
requires:
- test-pkg-tests-linux-node13
- test-pkg-tests-linux-node12
- test-pkg-tests-linux-node10
- test-pkg-tests-linux-node8
- test-linux-node13
- test-linux-node12
- test-linux-node10
- test-linux-node8
- test-linux-node6
- test-linux-node4
- test-macos-node10
- test-macos-node8
- test-macos-node6
- lint
- build