version: 2.1
jobs:
  build:
    parameters:
      ruby_version:
        type: string
        # https://circleci.com/docs/2.0/docker-image-tags.json
    docker:
      # https://circleci.com/developer/images/image/cimg/ruby
      - image: << parameters.ruby_version >>
    steps:
      - checkout
      - run: ruby --version
      - run: bundle install
      - run:
          name: Run tests
          command: bundle exec rake test:all
references:
  matrix_build: &matrix_build
    build:
      matrix:
        # https://circleci.com/docs/2.0/reusing-config/
        parameters:
          ruby_version: [
            "circleci/jruby",
            "cimg/ruby:2.6",
            "cimg/ruby:2.7",
            "cimg/ruby:3.0",
            "cimg/ruby:3.1"
          ]
workflows:
   version: 2
   commit:
     jobs:
       - <<: *matrix_build
version: 2.1
jobs:
  build:
    parameters:
      ruby_version:
        type: string
        # https://circleci.com/docs/2.0/docker-image-tags.json
    docker:
      # https://circleci.com/developer/images/image/cimg/ruby
      - image: << parameters.ruby_version >>
    steps:
      - checkout
      - run: ruby --version
      - run: bundle install
      - run:
          name: Run tests
          command: bundle exec rake test:all
      - run:
          name: Rubocop
          command: bundle exec rubocop
references:
  matrix_build: &matrix_build
    build:
      matrix:
        # https://circleci.com/docs/2.0/reusing-config/
        parameters:
          ruby_version: [
            "circleci/jruby",
            "cimg/ruby:2.6",
            "cimg/ruby:2.7",
            "cimg/ruby:3.0",
            "cimg/ruby:3.1"
          ]
workflows:
   version: 2
   commit:
     jobs:
       - <<: *matrix_build
Add `rubocop` to CircleCI task
Add `rubocop` to CircleCI task
