1- # CircleCI configuration for Spectrum
1+ # CircleCI configuration for Spectrum
2+ version : 2.1
23
34# Aliases
45aliases :
@@ -63,7 +64,6 @@ js_defaults: &js_defaults
6364 docker :
6465 - image : circleci/node:8
6566
66- version : 2
6767jobs :
6868
6969 # Set up environment and install required dependencies
7272 steps :
7373 - checkout
7474
75- - restore-cache : *restore-yarn-cache
75+ - restore_cache : *restore-yarn-cache
7676 - run : *yarn
77- - save-cache : *save-yarn-cache
77+ - save_cache : *save-yarn-cache
7878
7979 - persist_to_workspace :
8080 root : .
@@ -112,15 +112,19 @@ jobs:
112112
113113
114114 # Start db and servers, then run e2e and unit tests
115- test_e2e :
115+ test_integration :
116116 << : *defaults
117117 docker :
118118 - image : circleci/node:8-browsers
119119 - image : redis:3.2.7
120120 - image : cypress/base:6
121121 - image : rethinkdb:2.3.5
122- parallel : true
123- parallelism : 9
122+ parameters :
123+ parallelism :
124+ type : integer
125+ default : 1
126+ description : Number of boxes to use to run this job
127+ parallelism : <<parameters.parallelism>>
124128 environment :
125129 TERM : xterm
126130 steps :
@@ -144,6 +148,14 @@ jobs:
144148 yarn run test:e2e
145149 fi
146150
151+ # This runs after the above and is only here to hack around missing support for varying jobs based on external vs internal PRs
152+ # See https://github.com/withspectrum/spectrum/pull/4820
153+ test_e2e :
154+ docker :
155+ - image : cypress/base:10
156+ steps :
157+ - run : echo "pass"
158+
147159 # Run eslint, flow etc.
148160 test_static_js :
149161 << : *js_defaults
@@ -158,8 +170,6 @@ jobs:
158170 command : yarn run lint
159171
160172workflows :
161- version : 2
162-
163173 test :
164174 jobs :
165175 - checkout_environment
@@ -172,6 +182,26 @@ workflows:
172182 - build_web :
173183 requires :
174184 - checkout_environment
175- - test_e2e :
185+ # Run pull requests from internal contributors in parallel
186+ - test_integration :
187+ name : test_e2e_internal
188+ requires :
189+ - build_web
190+ parallelism : 4
191+ filters :
192+ branches :
193+ ignore : /pull.*/
194+ # Run pull requests from external contributors on one machine
195+ - test_integration :
196+ name : test_e2e_external
176197 requires :
177198 - build_web
199+ parallelism : 1
200+ filters :
201+ branches :
202+ only : /pull.*/
203+ # If either of the test_e2e_* jobs pass, this one passes so we can mark it as required on GitHub
204+ - test_e2e :
205+ requires :
206+ - test_e2e_internal
207+ - test_e2e_external
0 commit comments