1
1
aliases :
2
- - &restore-node -cache
2
+ - &restore-yarn -cache
3
3
keys :
4
- - v2-dependencies -{{ arch }}-{{ checksum "package.json" }}
4
+ - v1-yarn -{{ arch }}-{{ checksum "package.json" }}
5
5
# Fallback in case checksum fails
6
- - v2-dependencies-{{ arch }}-
7
-
8
- - &save-node-cache
6
+ - v1-yarn-{{ arch }}-
7
+ - &save-yarn-cache
9
8
paths :
10
9
- node_modules
11
- key : v2-dependencies-{{ arch }}-{{ checksum "package.json" }}
10
+ - ~/.cache/yarn
11
+ key : v1-yarn-{{ arch }}-{{ checksum "package.json" }}
12
12
13
13
- &restore-cache-analysis
14
14
keys :
@@ -60,6 +60,16 @@ aliases:
60
60
- ~/watchman
61
61
key : v1-watchman-{{ arch }}-v4.9.0
62
62
63
+ - &yarn
64
+ |
65
+ yarn install --non-interactive --cache-folder ~/.cache/yarn
66
+
67
+ - &install-yarn
68
+ |
69
+ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
70
+ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
71
+ sudo apt-get update && sudo apt-get install yarn
72
+
63
73
- &install-node-dependencies
64
74
|
65
75
npm install --no-package-lock --no-spin --no-progress
@@ -77,18 +87,18 @@ aliases:
77
87
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
78
88
sudo apt-get install -y nodejs
79
89
80
- - &run-node -tests
81
- |
82
- npm test -- --maxWorkers=2
83
-
90
+ - &run-js -tests
91
+ |
92
+ yarn test --maxWorkers=2
93
+
84
94
- &run-lint-checks
85
- |
86
- npm run lint
95
+ |
96
+ yarn lint
87
97
88
98
- &run-flow-checks
89
- |
90
- npm run flow -- check
91
-
99
+ |
100
+ yarn flow check
101
+
92
102
- &filter-only-master-stable
93
103
branches :
94
104
only :
@@ -203,9 +213,9 @@ jobs:
203
213
- image : circleci/node:8
204
214
steps :
205
215
- checkout
206
- - restore-cache : *restore-node -cache
207
- - run : *install-node-dependencies
208
- - save-cache : *save-node -cache
216
+ - restore-cache : *restore-yarn -cache
217
+ - run : *yarn
218
+ - save-cache : *save-yarn -cache
209
219
- run : *run-lint-checks
210
220
- run : *run-flow-checks
211
221
@@ -216,10 +226,10 @@ jobs:
216
226
- image : circleci/node:8
217
227
steps :
218
228
- checkout
219
- - restore-cache : *restore-node -cache
220
- - run : *install-node-dependencies
221
- - save-cache : *save-node -cache
222
- - run : *run-node -tests
229
+ - restore-cache : *restore-yarn -cache
230
+ - run : *yarn
231
+ - save-cache : *save-yarn -cache
232
+ - run : *run-js -tests
223
233
224
234
# Runs JavaScript tests on Node 6
225
235
test-js-node-6 :
@@ -228,10 +238,10 @@ jobs:
228
238
- image : circleci/node:6
229
239
steps :
230
240
- checkout
231
- - restore-cache : *restore-node -cache
232
- - run : *install-node-dependencies
233
- - save-cache : *save-node -cache
234
- - run : *run-node -tests
241
+ - restore-cache : *restore-yarn -cache
242
+ - run : *yarn
243
+ - save-cache : *save-yarn -cache
244
+ - run : *run-js -tests
235
245
236
246
# Runs unit tests on iOS devices
237
247
test-objc-ios :
@@ -243,9 +253,9 @@ jobs:
243
253
- xcrun instruments -w "iPhone 5s (10.3.1)" || true
244
254
steps :
245
255
- checkout
246
- - restore-cache : *restore-node -cache
247
- - run : *install-node-dependencies
248
- - save-cache : *save-node -cache
256
+ - restore-cache : *restore-yarn -cache
257
+ - run : *yarn
258
+ - save-cache : *save-yarn -cache
249
259
- run : ./scripts/objc-test-ios.sh
250
260
251
261
# Runs unit tests on tvOS devices
@@ -258,9 +268,9 @@ jobs:
258
268
- xcrun instruments -w "Apple TV 1080p (10.0)" || true
259
269
steps :
260
270
- checkout
261
- - restore-cache : *restore-node -cache
262
- - run : *install-node-dependencies
263
- - save-cache : *save-node -cache
271
+ - restore-cache : *restore-yarn -cache
272
+ - run : *yarn
273
+ - save-cache : *save-yarn -cache
264
274
- run : ./scripts/objc-test-tvos.sh
265
275
266
276
# Runs end to end tests
@@ -273,9 +283,9 @@ jobs:
273
283
- xcrun instruments -w "iPhone 5s (10.3.1)" || true
274
284
steps :
275
285
- checkout
276
- - restore-cache : *restore-node -cache
277
- - run : *install-node-dependencies
278
- - save-cache : *save-node -cache
286
+ - restore-cache : *restore-yarn -cache
287
+ - run : *yarn
288
+ - save-cache : *save-yarn -cache
279
289
- run : node ./scripts/run-ci-e2e-tests.js --ios --js --retries 3;
280
290
281
291
# Checks podspec
@@ -285,9 +295,9 @@ jobs:
285
295
xcode : " 9.0"
286
296
steps :
287
297
- checkout
288
- - restore-cache : *restore-node -cache
289
- - run : *install-node-dependencies
290
- - save-cache : *save-node -cache
298
+ - restore-cache : *restore-yarn -cache
299
+ - run : *yarn
300
+ - save-cache : *save-yarn -cache
291
301
- run : ./scripts/process-podspecs.sh
292
302
293
303
# Publishes new version onto npm
@@ -310,9 +320,10 @@ jobs:
310
320
- run : *install-buck
311
321
- save-cache : *save-cache-buck
312
322
- run : *install-node
313
- - restore-cache : *restore-node-cache
314
- - run : *install-node-dependencies
315
- - save-cache : *save-node-cache
323
+ - run : *install-yarn
324
+ - restore-cache : *restore-yarn-cache
325
+ - run : *yarn
326
+ - save-cache : *save-yarn-cache
316
327
- run : buck fetch ReactAndroid/src/test/java/com/facebook/react/modules
317
328
- run : buck fetch ReactAndroid/src/main/java/com/facebook/react
318
329
- run : buck fetch ReactAndroid/src/main/java/com/facebook/react/shell
@@ -372,9 +383,10 @@ jobs:
372
383
373
384
# The JavaScript Bundle is required for instrumentation tests.
374
385
- run : *install-node
375
- - restore-cache : *restore-node-cache
376
- - run : *install-node-dependencies
377
- - save-cache : *save-node-cache
386
+ - run : *install-yarn
387
+ - restore-cache : *restore-yarn-cache
388
+ - run : *yarn
389
+ - save-cache : *save-yarn-cache
378
390
- run : *build-js-bundle
379
391
380
392
# Wait for AVD to finish booting before running tests
@@ -398,14 +410,14 @@ jobs:
398
410
steps :
399
411
- checkout
400
412
- restore-cache : *restore-cache-analysis
401
- - run : *install-node-dependencies
413
+ - run : *yarn
402
414
- run :
403
- name : Install Dependencies
415
+ name : Install Additional Dependencies
404
416
command : |
405
417
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
406
-
418
+
407
419
cd danger
408
- npm install --no-package-lock --no-spin --no-progress
420
+ yarn install --non-interactive --cache-folder ~/.cache/yarn
409
421
else
410
422
echo "Skipping dependency installation."
411
423
fi
@@ -414,16 +426,16 @@ jobs:
414
426
name : Analyze Pull Request
415
427
command : |
416
428
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
417
- cd danger && DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" npm run danger
429
+ cd danger && DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" yarn danger
418
430
else
419
431
echo "Skipping pull request analysis."
420
432
fi
421
433
when : always
422
434
- run :
423
435
name : Analyze Code
424
436
command : |
425
- if [ -n "$CIRCLE_PULL_REQUEST " ]; then
426
- 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
437
+ if [ -n "$CIRCLE_PR_NUMBER " ]; then
438
+ cat <(echo eslint; yarn --silent lint --format=json; echo flow; yarn --silent flow 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
427
439
else
428
440
echo "Skipping code analysis."
429
441
fi
0 commit comments