@@ -88,8 +88,8 @@ aliases:
88
88
sudo apt-get install -y nodejs
89
89
90
90
- &run-js-tests
91
- |
92
- yarn test --maxWorkers=2
91
+ name : JavaScript Test Suite
92
+ command : yarn test-ci
93
93
94
94
- &run-lint-checks
95
95
|
@@ -183,11 +183,16 @@ aliases:
183
183
- &collect-android-test-results
184
184
name : Collect Test Results
185
185
command : |
186
- mkdir -p ~/ junit/
187
- find . -type f -regex ".*/build/test -results/debug /.*xml" -exec cp {} ~/junit/ \;
188
- find . -type f -regex ".*/outputs/androidTest-results/connected/.* xml" -exec cp {} ~/junit/ \;
186
+ find . -type f -regex ".*/build/test-results/debug/.*xml" -exec cp {} ~/reports/ junit/ \;
187
+ find . -type f -regex ".*/outputs/androidTest -results/connected /.*xml" -exec cp {} ~/reports /junit/ \;
188
+ find . -type f -regex ".*/buck-out/gen/ReactAndroid/src/test/.*/.* xml" -exec cp {} ~/reports /junit/ \;
189
189
when : always
190
190
191
+ - &setup-artifacts
192
+ name : Initial Setup
193
+ command : |
194
+ mkdir -p ~/reports/junit/
195
+
191
196
defaults : &defaults
192
197
working_directory : ~/react-native
193
198
@@ -213,6 +218,8 @@ jobs:
213
218
- image : circleci/node:8
214
219
steps :
215
220
- checkout
221
+ - run : *setup-artifacts
222
+
216
223
- restore-cache : *restore-yarn-cache
217
224
- run : *yarn
218
225
- save-cache : *save-yarn-cache
@@ -226,10 +233,16 @@ jobs:
226
233
- image : circleci/node:8
227
234
steps :
228
235
- checkout
236
+ - run : *setup-artifacts
237
+
229
238
- restore-cache : *restore-yarn-cache
230
239
- run : *yarn
231
240
- save-cache : *save-yarn-cache
232
241
- run : *run-js-tests
242
+ - store_test_results :
243
+ path : ~/reports/junit
244
+ - store_artifacts :
245
+ path : ~/reports/junit
233
246
234
247
# Runs JavaScript tests on Node 6
235
248
test-js-node-6 :
@@ -238,10 +251,16 @@ jobs:
238
251
- image : circleci/node:6
239
252
steps :
240
253
- checkout
254
+ - run : *setup-artifacts
255
+
241
256
- restore-cache : *restore-yarn-cache
242
257
- run : *yarn
243
258
- save-cache : *save-yarn-cache
244
259
- run : *run-js-tests
260
+ - store_test_results :
261
+ path : ~/reports/junit
262
+ - store_artifacts :
263
+ path : ~/reports/junit
245
264
246
265
# Runs unit tests on iOS devices
247
266
test-objc-ios :
@@ -253,10 +272,16 @@ jobs:
253
272
- xcrun instruments -w "iPhone 5s (10.3.1)" || true
254
273
steps :
255
274
- checkout
275
+ - run : *setup-artifacts
276
+
256
277
- restore-cache : *restore-yarn-cache
257
278
- run : *yarn
258
279
- save-cache : *save-yarn-cache
259
280
- run : ./scripts/objc-test-ios.sh
281
+ - store_test_results :
282
+ path : ~/reports/junit
283
+ - store_artifacts :
284
+ path : ~/reports/junit
260
285
261
286
# Runs unit tests on tvOS devices
262
287
test-objc-tvos :
@@ -268,10 +293,16 @@ jobs:
268
293
- xcrun instruments -w "Apple TV 1080p (10.0)" || true
269
294
steps :
270
295
- checkout
296
+ - run : *setup-artifacts
297
+
271
298
- restore-cache : *restore-yarn-cache
272
299
- run : *yarn
273
300
- save-cache : *save-yarn-cache
274
301
- run : ./scripts/objc-test-tvos.sh
302
+ - store_test_results :
303
+ path : ~/reports/junit
304
+ - store_artifacts :
305
+ path : ~/reports/junit
275
306
276
307
# Runs end to end tests
277
308
test-objc-e2e :
@@ -283,6 +314,8 @@ jobs:
283
314
- xcrun instruments -w "iPhone 5s (10.3.1)" || true
284
315
steps :
285
316
- checkout
317
+ - run : *setup-artifacts
318
+
286
319
- restore-cache : *restore-yarn-cache
287
320
- run : *yarn
288
321
- save-cache : *save-yarn-cache
@@ -295,6 +328,8 @@ jobs:
295
328
xcode : " 9.0"
296
329
steps :
297
330
- checkout
331
+ - run : *setup-artifacts
332
+
298
333
- restore-cache : *restore-yarn-cache
299
334
- run : *yarn
300
335
- save-cache : *save-yarn-cache
@@ -305,6 +340,7 @@ jobs:
305
340
<< : *android_defaults
306
341
steps :
307
342
- checkout
343
+ - run : *setup-artifacts
308
344
309
345
# Configure Android dependencies
310
346
- run : *configure-android-path
@@ -349,7 +385,8 @@ jobs:
349
385
<< : *android_defaults
350
386
steps :
351
387
- checkout
352
-
388
+ - run : *setup-artifacts
389
+
353
390
# Configure Android dependencies
354
391
- run : *configure-android-path
355
392
- run : *install-build-dependencies
@@ -399,22 +436,24 @@ jobs:
399
436
# post (always runs)
400
437
- run : *collect-android-test-results
401
438
- store_test_results :
402
- path : ~/junit
439
+ path : ~/reports/ junit
403
440
- store_artifacts :
404
- path : ~/junit
441
+ path : ~/reports/ junit
405
442
406
443
analyze-pull-request :
407
444
<< : *defaults
408
445
docker :
409
446
- image : circleci/node:8
410
447
steps :
411
448
- checkout
449
+ - run : *setup-artifacts
450
+
412
451
- restore-cache : *restore-cache-analysis
413
452
- run : *yarn
414
453
- run :
415
454
name : Install Additional Dependencies
416
455
command : |
417
- if [ -n "$CIRCLE_PULL_REQUEST " ]; then
456
+ if [ -n "$CIRCLE_PR_NUMBER " ]; then
418
457
yarn add github@0.2.4
419
458
cd danger
420
459
yarn install --non-interactive --cache-folder ~/.cache/yarn
@@ -425,22 +464,29 @@ jobs:
425
464
- run :
426
465
name : Analyze Pull Request
427
466
command : |
428
- if [ -n "$CIRCLE_PULL_REQUEST " ]; then
467
+ if [ -n "$CIRCLE_PR_NUMBER " ]; then
429
468
cd danger && DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" yarn danger
430
469
else
431
470
echo "Skipping pull request analysis."
432
471
fi
472
+ background : true
433
473
when : always
434
474
- run :
435
475
name : Analyze Code
436
476
command : |
437
477
if [ -n "$CIRCLE_PR_NUMBER" ]; then
438
478
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
479
+ yarn lint --format junit -o ~/reports/junit/js-lint-results.xml
439
480
else
440
481
echo "Skipping code analysis."
441
482
fi
483
+ background : true
442
484
when : always
443
-
485
+ - store_test_results :
486
+ path : ~/reports/junit
487
+ - store_artifacts :
488
+ path : ~/reports/junit
489
+
444
490
# Workflows enables us to run multiple jobs in parallel
445
491
workflows :
446
492
version : 2
0 commit comments