language: ruby
os: linux
dist: focal
jobs:
  include:
    - rvm: 2.6.7 # Test web AND cli with specific version
      gemfile: Gemfile
    - rvm: 2.4 # Test only the cli.
      gemfile: lib/vimgolf/Gemfile
    - rvm: 2.3 # Test only the cli, on older Ruby.
      dist: xenial
      gemfile: lib/vimgolf/Gemfile
    - rvm: 2.0 # Test only the cli, on older Ruby.
      dist: trusty
      gemfile: lib/vimgolf/Gemfile
services:
  - mongodb
before_install:
  - ls -l /home/travis/.rvm/gems # Future reference, targets for quick build
  - cd `dirname $BUNDLE_GEMFILE`
  - pwd # For debug info
  - gem install -v 1.16.2 bundler # Travis's Bundler 1.7.6 is causing problems
script:
  - bundle exec rake
addons:
  apt:
    sources:
      - mongodb-2.6-precise
  code_climate:
    repo_token: 87b58d792ac24c87c9eb7957aa3fe7e05f72f800619452853270ed6a8f5b3853
after_success:
  - bundle exec codeclimate-test-reporter

language: ruby
os: linux
dist: focal
env:
  - GOLFHOST=https://vimgolf-staging.herokuapp.com
jobs:
  include:
    - rvm: 2.6.7 # Test web AND cli with specific version
      gemfile: Gemfile
    - rvm: 2.4 # Test only the cli.
      gemfile: lib/vimgolf/Gemfile
    - rvm: 2.3 # Test only the cli, on older Ruby.
      dist: xenial
      gemfile: lib/vimgolf/Gemfile
    - rvm: 2.0 # Test only the cli, on older Ruby.
      dist: trusty
      gemfile: lib/vimgolf/Gemfile
services:
  - mongodb
before_install:
  - ls -l /home/travis/.rvm/gems # Future reference, targets for quick build
  - cd `dirname $BUNDLE_GEMFILE`
  - pwd # For debug info
  - gem install -v 1.16.2 bundler # Travis's Bundler 1.7.6 is causing problems
script:
  - bundle exec rake
addons:
  apt:
    sources:
      - mongodb-2.6-precise
  code_climate:
    repo_token: 87b58d792ac24c87c9eb7957aa3fe7e05f72f800619452853270ed6a8f5b3853
after_success:
  - bundle exec codeclimate-test-reporter

Use staging environment as GOLFHOST
Use staging environment as GOLFHOST

Since client and server version need to be in sync and one of our tests
hits production, let's run tests against the staging environment where
this branch has already been pushed. That way, the test that hits real
production will still succeed with the gem version already bumped in
this PR.

Tested:
$ GOLFHOST=https://vimgolf-staging.herokuapp.com bundle exec rspec spec/lib/challenge_spec.rb

Passes after having pushed this branch to heroku-staging.
