Skip to content

Commit 03ce0a7

Browse files
authored
Merge pull request #900 from rubocop-hq/ci-matrix
Use CircleCI matrix feature
2 parents cd6bc33 + 5ee222c commit 03ce0a7

File tree

1 file changed

+27
-63
lines changed

1 file changed

+27
-63
lines changed

.circleci/config.yml

Lines changed: 27 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
version: 2
2-
3-
rspec: &rspec
4-
steps:
5-
- checkout
6-
- run: bundle install
7-
- run: rake spec
8-
9-
rubocop: &rubocop
10-
steps:
11-
- checkout
12-
- run: bundle install
13-
- run: rake internal_investigation
1+
version: 2.1
142

153
jobs:
164
confirm_config_and_documentation:
@@ -21,45 +9,27 @@ jobs:
219
- run: bundle install
2210
- run: rake confirm_config documentation_syntax_check confirm_documentation
2311

24-
# Ruby 2.4
25-
ruby-2.4-rspec:
26-
docker:
27-
- image: circleci/ruby:2.4
28-
<<: *rspec
29-
ruby-2.4-rubocop:
30-
docker:
31-
- image: circleci/ruby:2.4
32-
<<: *rubocop
33-
34-
# Ruby 2.5
35-
ruby-2.5-rspec:
36-
docker:
37-
- image: circleci/ruby:2.5
38-
<<: *rspec
39-
ruby-2.5-rubocop:
40-
docker:
41-
- image: circleci/ruby:2.5
42-
<<: *rubocop
43-
44-
# Ruby 2.6
45-
ruby-2.6-rspec:
46-
docker:
47-
- image: circleci/ruby:2.6
48-
<<: *rspec
49-
ruby-2.6-rubocop:
12+
rspec:
13+
parameters:
14+
ruby:
15+
type: string
5016
docker:
51-
- image: circleci/ruby:2.6
52-
<<: *rubocop
17+
- image: circleci/ruby:<<parameters.ruby>>
18+
steps:
19+
- checkout
20+
- run: bundle install
21+
- run: rake spec
5322

54-
# Ruby 2.7
55-
ruby-2.7-rspec:
56-
docker:
57-
- image: circleci/ruby:2.7
58-
<<: *rspec
59-
ruby-2.7-rubocop:
23+
rubocop:
24+
parameters:
25+
ruby:
26+
type: string
6027
docker:
61-
- image: circleci/ruby:2.7
62-
<<: *rubocop
28+
- image: circleci/ruby:<<parameters.ruby>>
29+
steps:
30+
- checkout
31+
- run: bundle install
32+
- run: rake internal_investigation
6333

6434
edge-rubocop:
6535
docker:
@@ -118,22 +88,16 @@ workflows:
11888
- confirm_config_and_documentation
11989

12090
# Use `requires: [confirm_config_and_documentation]` to trick Circle CI into starting the slow jruby job early.
121-
- ruby-2.4-rspec:
122-
requires: [confirm_config_and_documentation]
123-
- ruby-2.4-rubocop:
124-
requires: [confirm_config_and_documentation]
125-
- ruby-2.5-rspec:
126-
requires: [confirm_config_and_documentation]
127-
- ruby-2.5-rubocop:
128-
requires: [confirm_config_and_documentation]
129-
- ruby-2.6-rspec:
130-
requires: [confirm_config_and_documentation]
131-
- ruby-2.6-rubocop:
132-
requires: [confirm_config_and_documentation]
133-
- ruby-2.7-rspec:
91+
- rspec:
13492
requires: [confirm_config_and_documentation]
135-
- ruby-2.7-rubocop:
93+
matrix:
94+
parameters:
95+
ruby: ['2.4', '2.5', '2.6', '2.7']
96+
- rubocop:
13697
requires: [confirm_config_and_documentation]
98+
matrix:
99+
parameters:
100+
ruby: ['2.4', '2.5', '2.6', '2.7']
137101
- edge-rubocop:
138102
requires: [confirm_config_and_documentation]
139103
- jruby

0 commit comments

Comments
 (0)