-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcircle.yml
294 lines (240 loc) · 6.55 KB
/
circle.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
version: 2
attach: &attach
attach_workspace:
at: /home/circleci
register_nypr_account_settings: ®ister_nypr_account_settings
run:
name: make global symlink
command: cd /home/circleci/nypr-account-settings && yarn link
node_key: &node_key
key: node-deps-{{ arch }}-{{ checksum "yarn.lock" }}-{{ checksum "circle.yml" }}
restore_node: &restore_node
restore_cache:
<<: *node_key
install_node: &install_node
run:
name: node deps
command: |
if [ ! -d node_modules ]; then
yarn --pure-lockfile
fi
save_node: &save_node
save_cache:
<<: *node_key
paths:
- node_modules
- ../codeclimate
install_codeclimate: &install_codeclimate
run:
name: Install CodeClimate
command: |
mkdir -p ../codeclimate
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ../codeclimate/cc-test-reporter
chmod +x ../codeclimate/cc-test-reporter
restore_bower: &restore_bower
restore_cache:
key: bower-deps-{{ arch }}-{{ checksum "bower.json" }}
install_bower: &install_bower
run:
name: bower deps
command: |
if [ ! -d bower_components ]; then
npx bower i
fi
save_bower: &save_bower
save_cache:
key: bower-deps-{{ arch }}-{{ checksum "bower.json" }}
paths:
- bower_components
build_modernizr: &build_modernizr
run:
name: Build modernizr
command: npx grunt modernizr:dist
run_client_tests: &run_client_tests
run:
name: link and test
command: |
yarn link nypr-account-settings
npx ember test
container_defaults: &defaults
docker:
- image: circleci/node:10-browsers
environment:
JOBS: 2
jobs:
install:
<<: *defaults
working_directory: /home/circleci/nypr-account-settings
steps:
- checkout
- <<: *restore_node
- <<: *install_node
- <<: *install_codeclimate
- <<: *save_node
- persist_to_workspace:
root: /home/circleci
paths:
- nypr-account-settings
test:
<<: *defaults
working_directory: /home/circleci/nypr-account-settings
environment:
CIRCLE_TEST_REPORTS: test-results
steps:
- checkout
- <<: *restore_node
- run:
name: Set up CodeClimate
command: ../codeclimate/cc-test-reporter before-build
- run:
name: Run addon tests
command: |
COVERAGE=true npx ember test
- run:
name: Upload coverate reports to CodeClimate
command: ../codeclimate/cc-test-reporter after-build --exit-code $?
- store_test_results:
path: test-results/
setup_test_clients:
docker:
- image: circleci/buildpack-deps:jessie
working_directory: /home/circleci
steps:
- run:
name: Keyscan Github
command: |
mkdir ~/.ssh
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- run:
name: clone clients
command: |
for client in wnyc wqxr new-sounds wnyc-studios; do
git clone git@github.com:nypublicradio/$client-web-client
done
- persist_to_workspace:
root: .
paths:
- wnyc-web-client
- wqxr-web-client
- new-sounds-web-client
- wnyc-studios-web-client
test_wnyc:
<<: *defaults
working_directory: /home/circleci/wnyc-web-client
environment:
CIRCLE_TEST_REPORTS: wnyc-test-results
steps:
- <<: *attach
- <<: *register_nypr_account_settings
- <<: *restore_node
- <<: *install_node
- <<: *save_node
- <<: *build_modernizr
- <<: *run_client_tests
- store_test_results:
path: wnyc-test-results/
test_wqxr:
<<: *defaults
working_directory: /home/circleci/wqxr-web-client
environment:
CIRCLE_TEST_REPORTS: wqxr-test-results
steps:
- <<: *attach
- <<: *register_nypr_account_settings
- <<: *restore_node
- <<: *install_node
- <<: *save_node
- <<: *build_modernizr
- <<: *run_client_tests
- store_test_results:
path: wqxr-test-results/
test_new_sounds:
<<: *defaults
working_directory: /home/circleci/new-sounds-web-client
environment:
CIRCLE_TEST_REPORTS: new-sounds-test-results
steps:
- <<: *attach
- <<: *register_nypr_account_settings
- <<: *restore_node
- <<: *install_node
- <<: *save_node
- <<: *run_client_tests
- store_test_results:
path: new-sounds-test-results/
test_wnyc_studios_ember:
<<: *defaults
parallelism: 4
working_directory: /home/circleci/wnyc-studios-web-client
environment:
CIRCLE_TEST_REPORTS: wnyc-studios-test-results
steps:
- <<: *attach
- <<: *register_nypr_account_settings
- <<: *restore_node
- <<: *install_node
- <<: *save_node
- <<: *build_modernizr
- run: |
cp .env.sample .env
npx ember exam --split=$CIRCLE_NODE_TOTAL --partition=$(($CIRCLE_NODE_INDEX + 1))
- store_test_results:
path: wnyc-studios-test-results/
test_wnyc_studios_cypress:
<<: *defaults
parallelism: 4
working_directory: /home/circleci/wnyc-studios-web-client
environment:
CIRCLE_TEST_REPORTS: wnyc-studios-test-results
steps:
- <<: *attach
- <<: *register_nypr_account_settings
- <<: *restore_node
- <<: *install_node
- <<: *save_node
- <<: *build_modernizr
- run: |
cp .env.sample .env
sudo apt-get install libgconf-2-4
yarn run cy:ci:test
- store_test_results:
path: wnyc-studios-test-results/
workflows:
version: 2
just-test:
jobs:
- install:
filters:
branches:
ignore: master
- test:
requires:
- install
test-all-clients:
jobs:
- install:
filters:
branches:
only: master
- test:
requires:
- install
- setup_test_clients:
requires:
- install
- test_wnyc:
requires:
- setup_test_clients
- test_wqxr:
requires:
- setup_test_clients
# studios and new sounds do not use account settings
# - test_wnyc_studios_ember:
# requires:
# - setup_test_clients
# - test_wnyc_studios_cypress:
# requires:
# - setup_test_clients
# - test_new_sounds:
# requires:
# - setup_test_clients