/
config.yml
498 lines (392 loc) · 11.4 KB
/
config.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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
---
version: 2.1
.install_rubygems: &install_rubygems
run:
name: Install a specific rubygems version
command: gem update --system 3.1.4
.install_bundler: &install_bundler
run:
name: Install a specific bundler version
command: gem install bundler -v 2.2.0.rc.2
.install_build_deps: &install_build_deps
run:
name: Install build dependencies so that sassc-rails extension builds
command: sudo apt install make gcc g++
.copy_current_gemfile: ©_current_gemfile
run:
name: Cat current Gemfile to a specific file so caching works
command: cat "$BUNDLE_GEMFILE.lock" > current_gemfile.lock
.restore_gems: &restore_gems
restore_cache:
keys:
- bundler-dependencies-{{ checksum "current_gemfile.lock" }}-{{ .Environment.CIRCLE_JOB }}
.install_dependencies: &install_dependencies
run:
name: Install dependencies
command: |
bundle config set --local path /root/project/vendor/bundle
bundle install --jobs 3
.save_gems: &save_gems
save_cache:
key: bundler-dependencies-{{ checksum "current_gemfile.lock" }}-{{ .Environment.CIRCLE_JOB }}
paths:
- vendor/bundle
.create_test_app: &create_test_app
run:
name: Create test app
command: COVERAGE=true PARALLEL_TEST_PROCESSORS=4 bin/rake setup
.restore_test_reporter: &restore_test_reporter
attach_workspace:
at: bin
.restore_coverage: &restore_coverage
attach_workspace:
at: coverage
.format_coverage: &format_coverage
run:
name: Format coverage
command: |
bin/prepare_coverage
bin/test-reporter format-coverage --output coverage/codeclimate.$CIRCLE_JOB.json
.save_coverage: &save_coverage
persist_to_workspace:
root: coverage
paths:
- codeclimate.*.json
.submit_coverage: &submit_coverage
run:
name: Upload coverage results to Code Climate
command: |
bin/test-reporter sum-coverage coverage/codeclimate.*.json
bin/test-reporter upload-coverage
.save_test_app: &save_test_app
persist_to_workspace:
root: tmp/test_apps
paths:
- rails_*
.restore_test_app_from_workspace: &restore_test_app_from_workspace
attach_workspace:
at: tmp/test_apps
.restore_test_times: &restore_test_times
restore_cache:
keys:
- testtime-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}
- testtime-master-{{ .Environment.CIRCLE_JOB }}
.run_tests: &run_tests
run:
name: Run RSpec tests
command: |
COVERAGE=true PARALLEL_TEST_PROCESSORS=4 PARALLEL_TEST_HEARTBEAT_INTERVAL=3600 bin/parallel_rspec spec/
COVERAGE=true RSPEC_FILESYSTEM_CHANGES=true bin/rspec
.run_features: &run_features
run:
name: Run Cucumber features
command: |
COVERAGE=true PARALLEL_TEST_PROCESSORS=4 PARALLEL_TEST_HEARTBEAT_INTERVAL=3600 bin/parallel_cucumber features/
COVERAGE=true bin/cucumber --profile filesystem-changes
COVERAGE=true bin/cucumber --profile class-reloading
.save_test_times: &save_test_times
save_cache:
key: testtime-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}
paths:
- tmp/parallel_runtime_rspec.log
- tmp/parallel_runtime_cucumber.log
.generate_docs: &generate_docs
run:
name: Generate docs
command: bin/rake docs:build
.run_lints: &run_lints
run:
name: Run lints
command: COVERAGE=true bin/rake lint
.run_bug_report_template: &run_bug_report_template
run:
name: Run bug report template
command: ACTIVE_ADMIN_PATH=. ruby tasks/bug_report_template.rb
.test_steps: &test_steps
- checkout
- *install_rubygems
- *install_bundler
- *install_build_deps
- *copy_current_gemfile
- *restore_gems
- *install_dependencies
- *save_gems
- *restore_test_app_from_workspace
- *restore_test_times
- *restore_test_reporter
- *run_tests
- *run_features
- *format_coverage
- *save_coverage
- *save_test_times
.test_app_steps: &test_app_steps
- checkout
- *install_rubygems
- *install_bundler
- *copy_current_gemfile
- *restore_gems
- *install_dependencies
- *restore_test_reporter
- *save_gems
- *create_test_app
- *format_coverage
- *save_coverage
- *save_test_app
jobs:
setup_coverage:
docker:
- image: circleci/ruby:2.7.1
steps:
- run:
name: Download Code Climate test-reporter
command: |
mkdir bin
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-0.8.0-linux-amd64 > bin/test-reporter
chmod +x bin/test-reporter
- persist_to_workspace:
root: bin
paths:
- test-reporter
upload_coverage:
docker:
- image: circleci/ruby:2.7.1
environment:
CC_TEST_REPORTER_ID: 8d5fcf7abea6d56c625104a9d1a81140a588a7f546f4fa9de9bc6ffc8feaaf70
steps:
- *restore_test_reporter
- *restore_coverage
- *submit_coverage
testapp52:
docker:
- image: circleci/ruby:2.7.1-node
user: root
environment:
BUNDLE_GEMFILE: gemfiles/rails_52/Gemfile
steps:
*test_app_steps
testapp60:
docker:
- image: circleci/ruby:2.7.1-node
user: root
environment:
BUNDLE_GEMFILE: Gemfile
steps:
*test_app_steps
testapp60turbolinks:
docker:
- image: circleci/ruby:2.7.1-node
user: root
environment:
BUNDLE_GEMFILE: gemfiles/rails_60_turbolinks/Gemfile
steps:
*test_app_steps
testapp60webpacker:
docker:
- image: circleci/ruby:2.7.1-node
user: root
environment:
BUNDLE_GEMFILE: gemfiles/rails_60_webpacker/Gemfile
steps:
*test_app_steps
lint_and_docs:
docker:
- image: circleci/ruby:2.7.1-node
user: root
environment:
BUNDLE_GEMFILE: Gemfile
steps:
- checkout
- *install_rubygems
- *install_bundler
- *copy_current_gemfile
- *restore_gems
- *install_dependencies
- *save_gems
- *generate_docs
- *restore_test_reporter
- *run_lints
- *run_bug_report_template
- *format_coverage
- *save_coverage
ruby25rails52:
docker:
- image: circleci/ruby:2.5.8-node-browsers@sha256:772449521f5bdc456b3da1226d4070c46b53868a7b7b41f4de2318f1358c8fe6
user: root
environment:
BUNDLE_GEMFILE: gemfiles/rails_52/Gemfile
steps:
*test_steps
ruby25rails60:
docker:
- image: circleci/ruby:2.5.8-node-browsers@sha256:772449521f5bdc456b3da1226d4070c46b53868a7b7b41f4de2318f1358c8fe6
user: root
environment:
BUNDLE_GEMFILE: Gemfile
steps:
*test_steps
ruby26rails52:
docker:
- image: circleci/ruby:2.6.6-node-browsers@sha256:6fecbb049a4a8a561566a0dd976a617443d14346a17e6d12d83db882684273e1
user: root
environment:
BUNDLE_GEMFILE: gemfiles/rails_52/Gemfile
steps:
*test_steps
ruby26rails60:
docker:
- image: circleci/ruby:2.6.6-node-browsers@sha256:6fecbb049a4a8a561566a0dd976a617443d14346a17e6d12d83db882684273e1
user: root
environment:
BUNDLE_GEMFILE: Gemfile
steps:
*test_steps
ruby26rails60turbolinks:
docker:
- image: circleci/ruby:2.6.6-node-browsers@sha256:6fecbb049a4a8a561566a0dd976a617443d14346a17e6d12d83db882684273e1
user: root
environment:
BUNDLE_GEMFILE: gemfiles/rails_60_turbolinks/Gemfile
steps:
*test_steps
ruby26rails60webpacker:
docker:
- image: circleci/ruby:2.6.6-node-browsers@sha256:6fecbb049a4a8a561566a0dd976a617443d14346a17e6d12d83db882684273e1
user: root
environment:
BUNDLE_GEMFILE: gemfiles/rails_60_webpacker/Gemfile
steps:
*test_steps
ruby27rails52:
docker:
- image: circleci/ruby:2.7.1-node-browsers@sha256:94789a1524fa16521f6397f05ff9d4569c102ae4479135ee3f78e3b4d25c1b0e
user: root
environment:
BUNDLE_GEMFILE: gemfiles/rails_52/Gemfile
steps:
*test_steps
ruby27rails60:
docker:
- image: circleci/ruby:2.7.1-node-browsers@sha256:94789a1524fa16521f6397f05ff9d4569c102ae4479135ee3f78e3b4d25c1b0e
user: root
environment:
BUNDLE_GEMFILE: Gemfile
steps:
*test_steps
ruby27rails60turbolinks:
docker:
- image: circleci/ruby:2.7.1-node-browsers@sha256:94789a1524fa16521f6397f05ff9d4569c102ae4479135ee3f78e3b4d25c1b0e
user: root
environment:
BUNDLE_GEMFILE: gemfiles/rails_60_turbolinks/Gemfile
steps:
*test_steps
ruby27rails60webpacker:
docker:
- image: circleci/ruby:2.7.1-node-browsers@sha256:94789a1524fa16521f6397f05ff9d4569c102ae4479135ee3f78e3b4d25c1b0e
user: root
environment:
BUNDLE_GEMFILE: gemfiles/rails_60_webpacker/Gemfile
steps:
*test_steps
jruby92rails52:
docker:
- image: circleci/jruby:9.2.13.0-node-browsers@sha256:7c1a2e5d083dbcbfd29c48ebaff1cbd6812824747570746577566dcf4685bb02
user: root
environment:
BUNDLE_GEMFILE: gemfiles/rails_52/Gemfile
JRUBY_OPTS: -J-Xmx1024m --dev --debug
steps:
*test_steps
jruby92rails60:
docker:
- image: circleci/jruby:9.2.13.0-node-browsers@sha256:7c1a2e5d083dbcbfd29c48ebaff1cbd6812824747570746577566dcf4685bb02
user: root
environment:
BUNDLE_GEMFILE: Gemfile
JRUBY_OPTS: -J-Xmx1024m --dev --debug
steps:
*test_steps
workflows:
version: 2
#
# The workflow has three types of jobs:
#
# * A lint job to run style checks.
# * Jobs that create test apps for each supported rails version.
# * Jobs that run tests, one for each supported [ruby_version, rails_version]
# combination. Every test job for a specific rails version reuses the test
# app created for that specific rails version.
#
build:
jobs:
- setup_coverage
- lint_and_docs:
requires:
- setup_coverage
- testapp52:
requires:
- setup_coverage
- testapp60:
requires:
- setup_coverage
- testapp60turbolinks:
requires:
- setup_coverage
- testapp60webpacker:
requires:
- setup_coverage
- ruby25rails52:
requires:
- testapp52
- ruby25rails60:
requires:
- testapp60
- ruby26rails52:
requires:
- testapp52
- ruby26rails60:
requires:
- testapp60
- ruby26rails60turbolinks:
requires:
- testapp60turbolinks
- ruby26rails60webpacker:
requires:
- testapp60webpacker
- ruby27rails52:
requires:
- testapp52
- ruby27rails60:
requires:
- testapp60
- ruby27rails60turbolinks:
requires:
- testapp60turbolinks
- ruby27rails60webpacker:
requires:
- testapp60webpacker
- jruby92rails52:
requires:
- testapp52
- jruby92rails60:
requires:
- testapp60
- upload_coverage:
requires:
- lint_and_docs
- testapp52
- testapp60
- testapp60turbolinks
- testapp60webpacker
- ruby25rails52
- ruby25rails60
- ruby26rails52
- ruby26rails60
- ruby26rails60turbolinks
- ruby26rails60webpacker
- ruby27rails52
- ruby27rails60
- ruby27rails60turbolinks
- ruby27rails60webpacker
- jruby92rails52
- jruby92rails60