1
1
aliases :
2
+ # Cache Management
2
3
- &restore-yarn-cache
3
4
keys :
4
5
- v1-yarn-{{ arch }}-{{ checksum "package.json" }}
@@ -34,11 +35,6 @@ aliases:
34
35
- &restore-cache-ndk
35
36
keys :
36
37
- v1-android-ndk-{{ arch }}-r10e-32-64
37
-
38
- - &install-ndk
39
- |
40
- source scripts/circle-ci-android-setup.sh && getAndroidNDK
41
-
42
38
- &save-cache-ndk
43
39
paths :
44
40
- /opt/ndk
@@ -60,6 +56,34 @@ aliases:
60
56
- ~/watchman
61
57
key : v1-watchman-{{ arch }}-v4.9.0
62
58
59
+ # Branch Filtering
60
+ - &filter-only-master-stable
61
+ branches :
62
+ only :
63
+ - /.*-stable/
64
+ - master
65
+
66
+ - &filter-only-stable
67
+ branches :
68
+ only :
69
+ - /.*-stable/
70
+
71
+ - &filter-ignore-gh-pages
72
+ branches :
73
+ ignore : gh-pages
74
+
75
+ - &filter-ignore-master-stable
76
+ branches :
77
+ ignore :
78
+ - master
79
+ - /.*-stable/
80
+ - gh-pages
81
+
82
+ # Dependency Management
83
+ - &install-ndk
84
+ |
85
+ source scripts/circle-ci-android-setup.sh && getAndroidNDK
86
+
63
87
- &yarn
64
88
|
65
89
yarn install --non-interactive --cache-folder ~/.cache/yarn
@@ -87,40 +111,6 @@ aliases:
87
111
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
88
112
sudo apt-get install -y nodejs
89
113
90
- - &run-js-tests
91
- name : JavaScript Test Suite
92
- command : yarn test-ci
93
-
94
- - &run-lint-checks
95
- |
96
- yarn lint
97
-
98
- - &run-flow-checks
99
- |
100
- yarn flow check
101
-
102
- - &filter-only-master-stable
103
- branches :
104
- only :
105
- - /.*-stable/
106
- - master
107
-
108
- - &filter-only-stable
109
- branches :
110
- only :
111
- - /.*-stable/
112
-
113
- - &filter-ignore-gh-pages
114
- branches :
115
- ignore : gh-pages
116
-
117
- - &filter-ignore-master-stable
118
- branches :
119
- ignore :
120
- - master
121
- - /.*-stable/
122
- - gh-pages
123
-
124
114
- &create-ndk-directory
125
115
|
126
116
if [[ ! -e /opt/ndk ]]; then
@@ -144,6 +134,21 @@ aliases:
144
134
sudo apt-get update -y
145
135
sudo apt-get install ant autoconf automake g++ gcc libqt5widgets5 lib32z1 lib32stdc++6 make maven python-dev python3-dev qml-module-qtquick-controls qtdeclarative5-dev file -y
146
136
137
+ # Test Definitions
138
+ - &run-js-tests
139
+ name : JavaScript Test Suite
140
+ command : yarn test-ci
141
+
142
+ - &run-lint-checks
143
+ name : Lint code
144
+ command : yarn lint --format junit -o ~/reports/junit/js-lint-results.xml
145
+ when : always
146
+
147
+ - &run-flow-checks
148
+ name : Check for errors in code using Flow
149
+ command : yarn flow check
150
+ when : always
151
+
147
152
- &build-android-app
148
153
name : Build Android App
149
154
command : |
@@ -193,6 +198,22 @@ aliases:
193
198
command : |
194
199
mkdir -p ~/reports/junit/
195
200
201
+ - &run-objc-ios-tests
202
+ name : Objective-C iOS Test Suite
203
+ command : ./scripts/objc-test-ios.sh
204
+
205
+ - &run-objc-tvos-tests
206
+ name : Objective-C tvOS Test Suite
207
+ command : ./scripts/objc-test-tvos.sh
208
+
209
+ - &run-objc-ios-e2e-tests
210
+ name : Objective-C iOS End-to-End Test Suite
211
+ command : node ./scripts/run-ci-e2e-tests.js --ios --js --retries 3;
212
+
213
+ - &run-objc-tvos-e2e-tests
214
+ name : Objective-C tvOS End-to-End Test Suite
215
+ command : node ./scripts/run-ci-e2e-tests.js --tvos --js --retries 3;
216
+
196
217
defaults : &defaults
197
218
working_directory : ~/react-native
198
219
@@ -211,7 +232,8 @@ android_defaults: &android_defaults
211
232
212
233
version : 2
213
234
jobs :
214
- # Runs JavaScript lint and flow checks
235
+ # Runs JavaScript lint and flow checks.
236
+ # Currently will fail a PR if lint/flow raises issues.
215
237
run-js-checks :
216
238
<< : *defaults
217
239
docker :
@@ -223,9 +245,15 @@ jobs:
223
245
- restore-cache : *restore-yarn-cache
224
246
- run : *yarn
225
247
- save-cache : *save-yarn-cache
248
+
226
249
- run : *run-lint-checks
227
250
- run : *run-flow-checks
228
251
252
+ - store_test_results :
253
+ path : ~/reports/junit
254
+ - store_artifacts :
255
+ path : ~/reports/junit
256
+
229
257
# Runs JavaScript tests on Node 8
230
258
test-js-node-8 :
231
259
<< : *defaults
@@ -238,7 +266,9 @@ jobs:
238
266
- restore-cache : *restore-yarn-cache
239
267
- run : *yarn
240
268
- save-cache : *save-yarn-cache
269
+
241
270
- run : *run-js-tests
271
+
242
272
- store_test_results :
243
273
path : ~/reports/junit
244
274
- store_artifacts :
@@ -256,7 +286,9 @@ jobs:
256
286
- restore-cache : *restore-yarn-cache
257
287
- run : *yarn
258
288
- save-cache : *save-yarn-cache
289
+
259
290
- run : *run-js-tests
291
+
260
292
- store_test_results :
261
293
path : ~/reports/junit
262
294
- store_artifacts :
@@ -277,7 +309,9 @@ jobs:
277
309
- restore-cache : *restore-yarn-cache
278
310
- run : *yarn
279
311
- save-cache : *save-yarn-cache
280
- - run : ./scripts/objc-test-ios.sh
312
+
313
+ - run : *run-objc-ios-tests
314
+
281
315
- store_test_results :
282
316
path : ~/reports/junit
283
317
- store_artifacts :
@@ -298,14 +332,16 @@ jobs:
298
332
- restore-cache : *restore-yarn-cache
299
333
- run : *yarn
300
334
- save-cache : *save-yarn-cache
301
- - run : ./scripts/objc-test-tvos.sh
335
+
336
+ - run : *run-objc-tvos-tests
337
+
302
338
- store_test_results :
303
339
path : ~/reports/junit
304
340
- store_artifacts :
305
341
path : ~/reports/junit
306
342
307
343
# Runs end to end tests
308
- test-objc-e2e :
344
+ test-e2e- objc-ios :
309
345
<< : *defaults
310
346
macos :
311
347
xcode : " 9.0"
@@ -319,7 +355,13 @@ jobs:
319
355
- restore-cache : *restore-yarn-cache
320
356
- run : *yarn
321
357
- save-cache : *save-yarn-cache
322
- - run : node ./scripts/run-ci-e2e-tests.js --ios --js --retries 3;
358
+
359
+ - run : *run-objc-ios-e2e-tests
360
+
361
+ - store_test_results :
362
+ path : ~/reports/junit
363
+ - store_artifacts :
364
+ path : ~/reports/junit
323
365
324
366
# Checks podspec
325
367
test-podspec :
@@ -440,13 +482,15 @@ jobs:
440
482
- store_artifacts :
441
483
path : ~/reports/junit
442
484
485
+ # Analyze pull request and raise any lint/flow issues.
486
+ # Issues will be posted to the PR itself via GitHub bots.
487
+ # This workflow should only fail if the bots fail to run.
443
488
analyze-pull-request :
444
489
<< : *defaults
445
490
docker :
446
491
- image : circleci/node:8
447
492
steps :
448
493
- checkout
449
- - run : *setup-artifacts
450
494
451
495
- restore-cache : *restore-cache-analysis
452
496
- run : *yarn
@@ -469,23 +513,16 @@ jobs:
469
513
else
470
514
echo "Skipping pull request analysis."
471
515
fi
472
- background : true
473
516
when : always
474
517
- run :
475
518
name : Analyze Code
476
519
command : |
477
520
if [ -n "$CIRCLE_PR_NUMBER" ]; then
478
521
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
480
522
else
481
523
echo "Skipping code analysis."
482
524
fi
483
- background : true
484
525
when : always
485
- - store_test_results :
486
- path : ~/reports/junit
487
- - store_artifacts :
488
- path : ~/reports/junit
489
526
490
527
# Workflows enables us to run multiple jobs in parallel
491
528
workflows :
@@ -513,8 +550,13 @@ workflows:
513
550
filters : *filter-ignore-gh-pages
514
551
- test-objc-tvos :
515
552
filters : *filter-ignore-gh-pages
516
- - test-objc-e2e :
553
+
554
+ # End-to-end tests
555
+ - test-e2e-objc-ios :
517
556
filters : *filter-ignore-gh-pages
557
+ requires :
558
+ - test-objc-ios
559
+ - test-js-node-8
518
560
519
561
# If we are on a stable branch, deploy to `npm`
520
562
- hold :
0 commit comments