language: ruby

sudo: false

cache: bundler

script:
  - "ruby -e \"RUBY_VERSION == '3.0.0' ? system('bundle exec rubocop') : exit(0)\""
  - bundle exec rake spec

rvm:
  - 2.5.8
  - 2.6.6
  - 2.7.2
  - 3.0.0

gemfile:
  - gemfiles/rails_5.0.gemfile
  - gemfiles/rails_5.1.gemfile
  - gemfiles/rails_5.2.gemfile
  - gemfiles/rails_6.0.gemfile
  - gemfiles/rails_6.1.gemfile

matrix:
  exclude:
    # Rails < 6 does not support Ruby 3+, see:
    # https://github.com/rails/rails/issues/40938#issuecomment-751357907
    - rvm: 3.0.0
      gemfile: gemfiles/rails_5.0.gemfile
    - rvm: 3.0.0
      gemfile: gemfiles/rails_5.1.gemfile
    - rvm: 3.0.0
      gemfile: gemfiles/rails_5.2.gemfile

addons:
  code_climate:
    repo_token: 60e4a18e2a4bc86a98f92847f16756876c13d1e772058a9b3296643b04a697d7

language: ruby

sudo: false

cache: bundler

script:
  - "ruby -e \"RUBY_VERSION == '3.0.1' ? system('bundle exec rubocop') : exit(0)\""
  - bundle exec rake spec

rvm:
  - 2.5.9
  - 2.6.7
  - 2.7.3
  - 3.0.1

gemfile:
  - gemfiles/rails_5.0.gemfile
  - gemfiles/rails_5.1.gemfile
  - gemfiles/rails_5.2.gemfile
  - gemfiles/rails_6.0.gemfile
  - gemfiles/rails_6.1.gemfile

matrix:
  exclude:
    # Rails < 6 does not support Ruby 3+, see:
    # https://github.com/rails/rails/issues/40938#issuecomment-751357907
    - rvm: 3.0.1
      gemfile: gemfiles/rails_5.0.gemfile
    - rvm: 3.0.1
      gemfile: gemfiles/rails_5.1.gemfile
    - rvm: 3.0.1
      gemfile: gemfiles/rails_5.2.gemfile

addons:
  code_climate:
    repo_token: 60e4a18e2a4bc86a98f92847f16756876c13d1e772058a9b3296643b04a697d7

Test against the latest Ruby versions
Test against the latest Ruby versions