forked from rubocop/rubocop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
333 lines (314 loc) · 7.54 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
version: 2
jruby_env: &jruby_env
# By default we have 2 CPUs and 4GB ram available
# https://circleci.com/docs/2.0/configuration-reference/#resource_class
JRUBY_OPTS: "--debug -J-Xmn1024m -J-Xms2048m -J-Xmx2048m"
common_env: &common_env
# CircleCI container has two cores, but Ruby can see 32 cores. So we
# configure test-queue.
# See https://github.com/tmm1/test-queue#environment-variables
TEST_QUEUE_WORKERS: 2
spec_steps: &spec_steps
- checkout
- attach_workspace:
at: ~/project/tmp
- run: bundle install
- run:
name: Run specs
command: |
./tmp/cc-test-reporter before-build
COVERAGE=true bundle exec rake spec
./tmp/cc-test-reporter format-coverage --output tmp/codeclimate.$CIRCLE_JOB.json
- persist_to_workspace:
root: tmp
paths:
- codeclimate.*.json
ascii_spec_steps: &ascii_spec_steps
- checkout
- run: bundle install
- run: bundle exec rake ascii_spec
rubocop_steps: &rubocop_steps
- checkout
- run: bundle install
- run: bundle exec rake internal_investigation
- run:
name: Check requiring libraries successfully
# See https://github.com/rubocop-hq/rubocop/pull/4523#issuecomment-309136113
command: |
ruby -I lib -r rubocop -e 'exit 0'
jobs:
# Ruby 2.2
ruby-2.2-spec:
docker:
- image: circleci/ruby:2.2
environment:
<<: *common_env
steps:
*spec_steps
ruby-2.2-ascii_spec:
docker:
- image: circleci/ruby:2.2
environment:
<<: *common_env
steps:
*ascii_spec_steps
ruby-2.2-rubocop:
docker:
- image: circleci/ruby:2.2
environment:
<<: *common_env
steps:
*rubocop_steps
# Ruby 2.3
ruby-2.3-spec:
docker:
- image: circleci/ruby:2.3
environment:
<<: *common_env
steps:
*spec_steps
ruby-2.3-ascii_spec:
docker:
- image: circleci/ruby:2.3
environment:
<<: *common_env
steps:
*ascii_spec_steps
ruby-2.3-rubocop:
docker:
- image: circleci/ruby:2.3
environment:
<<: *common_env
steps:
*rubocop_steps
# Ruby 2.4
ruby-2.4-spec:
docker:
- image: circleci/ruby:2.4
environment:
<<: *common_env
steps:
*spec_steps
ruby-2.4-ascii_spec:
docker:
- image: circleci/ruby:2.4
environment:
<<: *common_env
steps:
*ascii_spec_steps
ruby-2.4-rubocop:
docker:
- image: circleci/ruby:2.4
environment:
<<: *common_env
steps:
*rubocop_steps
# Ruby 2.5
ruby-2.5-spec:
docker:
- image: circleci/ruby:2.5
environment:
<<: *common_env
steps:
*spec_steps
ruby-2.5-ascii_spec:
docker:
- image: circleci/ruby:2.5
environment:
<<: *common_env
steps:
*ascii_spec_steps
ruby-2.5-rubocop:
docker:
- image: circleci/ruby:2.5
environment:
<<: *common_env
steps:
*rubocop_steps
# Ruby 2.6
ruby-2.6-spec:
docker:
- image: circleci/ruby:2.6
environment:
<<: *common_env
steps:
*spec_steps
ruby-2.6-ascii_spec:
docker:
- image: circleci/ruby:2.6
environment:
<<: *common_env
steps:
*ascii_spec_steps
ruby-2.6-rubocop:
docker:
- image: circleci/ruby:2.6
environment:
<<: *common_env
steps:
*rubocop_steps
# ruby-head (nightly snapshot build)
ruby-head-spec:
docker:
- image: rubocophq/circleci-ruby-snapshot:latest
environment:
<<: *common_env
steps:
*spec_steps
ruby-head-ascii_spec:
docker:
- image: rubocophq/circleci-ruby-snapshot:latest
environment:
<<: *common_env
steps:
*ascii_spec_steps
ruby-head-rubocop:
docker:
- image: rubocophq/circleci-ruby-snapshot:latest
environment:
<<: *common_env
steps:
*rubocop_steps
# With JIT compiler enabled!
ruby-head-spec-with-jit:
docker:
- image: rubocophq/circleci-ruby-snapshot:latest
environment:
RUBYOPT: '--jit'
<<: *common_env
steps:
*spec_steps
ruby-head-rubocop-with-jit:
docker:
- image: rubocophq/circleci-ruby-snapshot:latest
environment:
RUBYOPT: '--jit'
<<: *common_env
steps:
*rubocop_steps
# JRuby 9.2
jruby-9.2-spec:
docker:
- image: circleci/jruby:9.2
environment:
<<: *common_env
<<: *jruby_env
steps:
*spec_steps
jruby-9.2-ascii_spec:
docker:
- image: circleci/jruby:9.2
environment:
<<: *common_env
<<: *jruby_env
steps:
*ascii_spec_steps
jruby-9.2-rubocop:
docker:
- image: circleci/jruby:9.2
environment:
<<: *common_env
<<: *jruby_env
steps:
*rubocop_steps
# Job for downloading the Code Climate test reporter
cc-setup:
docker:
- image: circleci/ruby
environment:
<<: *common_env
steps:
- run:
name: Download Code Climate test-reporter
command: |
mkdir -p tmp/
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
chmod +x ./tmp/cc-test-reporter
- persist_to_workspace:
root: tmp
paths:
- cc-test-reporter
# Job for merging code coverage results and sending them to Code Climate
cc-upload-coverage:
docker:
- image: circleci/ruby
environment:
CC_TEST_REPORTER_ID: a11b66bfbb1acdf220d5cb317b2e945a986fd85adebe29a76d411ad6d74ec31f
environment:
<<: *common_env
steps:
- attach_workspace:
at: ~/project/tmp
- run:
name: Upload coverage results to Code Climate
command: |
./tmp/cc-test-reporter sum-coverage tmp/codeclimate.*.json --parts 6 --output tmp/codeclimate.total.json
./tmp/cc-test-reporter upload-coverage --input tmp/codeclimate.total.json
# Miscellaneous tasks
documentation-checks:
docker:
- image: circleci/ruby
environment:
<<: *common_env
steps:
- checkout
- run: bundle install
- run:
name: Check documentation syntax
command: bundle exec rake documentation_syntax_check
- run:
name: Build documentation and check that manual files are in sync
command: bundle exec rake generate_cops_documentation
workflows:
version: 2
build:
jobs:
- documentation-checks
- cc-setup
- ruby-2.2-spec:
requires:
- cc-setup
- ruby-2.2-ascii_spec
- ruby-2.2-rubocop
- ruby-2.3-spec:
requires:
- cc-setup
- ruby-2.3-ascii_spec
- ruby-2.3-rubocop
- ruby-2.4-spec:
requires:
- cc-setup
- ruby-2.4-ascii_spec
- ruby-2.4-rubocop
- ruby-2.5-spec:
requires:
- cc-setup
- ruby-2.5-ascii_spec
- ruby-2.5-rubocop
- ruby-2.6-spec:
requires:
- cc-setup
- ruby-2.6-ascii_spec
- ruby-2.6-rubocop
- ruby-head-spec:
requires:
- cc-setup
- ruby-head-spec-with-jit:
requires:
- cc-setup
- ruby-head-ascii_spec
- ruby-head-rubocop
- ruby-head-rubocop-with-jit
- jruby-9.2-spec:
requires:
- cc-setup
- jruby-9.2-ascii_spec
- jruby-9.2-rubocop
- cc-upload-coverage:
requires:
- ruby-2.2-spec
- ruby-2.3-spec
- ruby-2.4-spec
- ruby-2.5-spec
- ruby-2.6-spec
- jruby-9.2-spec