version: 2

aliases:
  build-steps: &build-steps
    - checkout
    - run:
        name: Install dependencies
        command: |
          apt-get update
          apt-get install -y libidn11-dev
          bundle install
    - run:
        name: Run Rubocop
        command: |
          bundle exec rubocop --parallel --fail-level warning
    - run:
        name: Run RSpec
        command: |
          bundle exec rspec

jobs:
  build-2.4:
    docker:
      - image: ruby:2.4
    steps:
      *build-steps

  build-2.5:
    docker:
      - image: ruby:2.5
    steps:
      *build-steps

  build-2.6:
    docker:
      - image: ruby:2.6
    steps:
      *build-steps

  build-2.7:
    docker:
      - image: ruby:2.7
    steps:
      *build-steps

workflows:
  version: 2

  build:
    jobs:
      - build-2.4
      - build-2.5
      - build-2.6
      - build-2.7

version: 2

aliases:
  build-steps: &build-steps
    - checkout
    - run:
        name: Install dependencies
        command: |
          apt-get update
          apt-get install -y libidn11-dev
          gem install bundler:1.16.2
          bundle install
    - run:
        name: Run Rubocop
        command: |
          bundle exec rubocop --parallel --fail-level warning
    - run:
        name: Run RSpec
        command: |
          bundle exec rspec

jobs:
  build-2.4:
    docker:
      - image: ruby:2.4
    steps:
      *build-steps

  build-2.5:
    docker:
      - image: ruby:2.5
    steps:
      *build-steps

  build-2.6:
    docker:
      - image: ruby:2.6
    steps:
      *build-steps

  build-2.7:
    docker:
      - image: ruby:2.7
    steps:
      *build-steps

workflows:
  version: 2

  build:
    jobs:
      - build-2.4
      - build-2.5
      - build-2.6
      - build-2.7

Install specific version of bundler
Install specific version of bundler
