language: ruby
sudo: false
cache: bundler
script: bundle exec rake $TASK

os:
  - linux
  - osx
rvm:
  - "2.2.0"
  - "2.3.0"
  - "2.4.0"
  - "2.5.0"
  - "2.6.0"
  - "2.7.0"
env:
 - TASK=test
matrix:
  exclude:
    - os: osx
      rvm: "2.2.0"
    - os: osx
      rvm: "2.3.0"
  # No point running Rubocop on different rubies, results will be same.
  # The rubies it expects the code to target are controlled in .rubocop.yml.
  include:
    - os: linux
      rvm: "2.5.0"
      env: TASK=rubocop
