Skip to content

Commit

Permalink
Merge pull request #900 from rubocop-hq/ci-matrix
Browse files Browse the repository at this point in the history
Use CircleCI matrix feature
  • Loading branch information
bquorning authored Apr 27, 2020
2 parents cd6bc33 + 5ee222c commit 03ce0a7
Showing 1 changed file with 27 additions and 63 deletions.
90 changes: 27 additions & 63 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
version: 2

rspec: &rspec
steps:
- checkout
- run: bundle install
- run: rake spec

rubocop: &rubocop
steps:
- checkout
- run: bundle install
- run: rake internal_investigation
version: 2.1

jobs:
confirm_config_and_documentation:
Expand All @@ -21,45 +9,27 @@ jobs:
- run: bundle install
- run: rake confirm_config documentation_syntax_check confirm_documentation

# Ruby 2.4
ruby-2.4-rspec:
docker:
- image: circleci/ruby:2.4
<<: *rspec
ruby-2.4-rubocop:
docker:
- image: circleci/ruby:2.4
<<: *rubocop

# Ruby 2.5
ruby-2.5-rspec:
docker:
- image: circleci/ruby:2.5
<<: *rspec
ruby-2.5-rubocop:
docker:
- image: circleci/ruby:2.5
<<: *rubocop

# Ruby 2.6
ruby-2.6-rspec:
docker:
- image: circleci/ruby:2.6
<<: *rspec
ruby-2.6-rubocop:
rspec:
parameters:
ruby:
type: string
docker:
- image: circleci/ruby:2.6
<<: *rubocop
- image: circleci/ruby:<<parameters.ruby>>
steps:
- checkout
- run: bundle install
- run: rake spec

# Ruby 2.7
ruby-2.7-rspec:
docker:
- image: circleci/ruby:2.7
<<: *rspec
ruby-2.7-rubocop:
rubocop:
parameters:
ruby:
type: string
docker:
- image: circleci/ruby:2.7
<<: *rubocop
- image: circleci/ruby:<<parameters.ruby>>
steps:
- checkout
- run: bundle install
- run: rake internal_investigation

edge-rubocop:
docker:
Expand Down Expand Up @@ -118,22 +88,16 @@ workflows:
- confirm_config_and_documentation

# Use `requires: [confirm_config_and_documentation]` to trick Circle CI into starting the slow jruby job early.
- ruby-2.4-rspec:
requires: [confirm_config_and_documentation]
- ruby-2.4-rubocop:
requires: [confirm_config_and_documentation]
- ruby-2.5-rspec:
requires: [confirm_config_and_documentation]
- ruby-2.5-rubocop:
requires: [confirm_config_and_documentation]
- ruby-2.6-rspec:
requires: [confirm_config_and_documentation]
- ruby-2.6-rubocop:
requires: [confirm_config_and_documentation]
- ruby-2.7-rspec:
- rspec:
requires: [confirm_config_and_documentation]
- ruby-2.7-rubocop:
matrix:
parameters:
ruby: ['2.4', '2.5', '2.6', '2.7']
- rubocop:
requires: [confirm_config_and_documentation]
matrix:
parameters:
ruby: ['2.4', '2.5', '2.6', '2.7']
- edge-rubocop:
requires: [confirm_config_and_documentation]
- jruby
Expand Down

0 comments on commit 03ce0a7

Please sign in to comment.