env:
  - BUNDLE_DISABLE_EXEC_LOAD=true # Based on https://github.com/grosser/parallel_tests/issues/649#issuecomment-487100470
addons:
  postgresql: "9.6"
rvm:
  - 2.3.0
  - 2.4.0
  - 2.5.0
  - 2.6.0
gemfile:
  - gemfiles/rails_5.0.gemfile
  - gemfiles/rails_5.1.gemfile
  - gemfiles/rails_5.2.gemfile
  - gemfiles/rails_6.0.gemfile
matrix:
  exclude:
  - rvm: 2.3.0
    gemfile: gemfiles/rails_6.0.gemfile
  - rvm: 2.4.0
    gemfile: gemfiles/rails_6.0.gemfile
before_install:
  - gem install --force bundler -v 1.17.3
script:
  - bundle _1.17.3_ exec rubocop
  - sh -c 'cd spec/dummy && bundle _1.17.3_ exec bin/rake db:reset'
  - sh -c 'cd spec/dummy && bundle _1.17.3_ exec bin/rake parallel:create[3]'
  - bundle _1.17.3_ exec parallel_rspec spec -n3

env:
  - BUNDLE_DISABLE_EXEC_LOAD=true # Based on https://github.com/grosser/parallel_tests/issues/649#issuecomment-487100470
addons:
  postgresql: "9.6"
env:
  - POSTGRESQL_VERSION=9.6
  - POSTGRESQL_VERSION=10.11
  - POSTGRESQL_VERSION=11.6
  - POSTGRESQL_VERSION=12.1
rvm:
  - 2.3.0
  - 2.4.0
  - 2.5.0
  - 2.6.0
gemfile:
  - gemfiles/rails_5.0.gemfile
  - gemfiles/rails_5.1.gemfile
  - gemfiles/rails_5.2.gemfile
  - gemfiles/rails_6.0.gemfile
matrix:
  exclude:
  - rvm: 2.3.0
    gemfile: gemfiles/rails_6.0.gemfile
  - rvm: 2.4.0
    gemfile: gemfiles/rails_6.0.gemfile
before_install:
  - sudo service postgresql stop && sudo service postgresql start $POSTGRESQL_VERSION
  - gem install --force bundler -v 1.17.3
script:
  - bundle _1.17.3_ exec rubocop
  - sh -c 'cd spec/dummy && bundle _1.17.3_ exec bin/rake db:reset'
  - sh -c 'cd spec/dummy && bundle _1.17.3_ exec bin/rake parallel:create[3]'
  - bundle _1.17.3_ exec parallel_rspec spec -n3

Test with multiple versions of postgresql server
Test with multiple versions of postgresql server

Solution inspired by https://github.com/travis-ci/travis-ci/issues/954#issuecomment-301121352
