language: node_js
node_js:
- 8.9.4
cache:
  bundler: true
  yarn: true
before_script:
- sudo apt-get install curl -y
- mv node_modules/.bin/which node_modules/.bin/which.backup
- rvm install 2.5.1 && rvm use 2.5.1
- cp config/database.travis.yml config/database.yml
- bundle install --jobs=3 --retry=3
- bundle exec rake db:create db:migrate
- yarn install
script:
- export SECRET_TOKEN=e815982094c62436066bafc9151f2d33c4a351a776654cb7487476de260a4592
- export MQTT_HOST=example.com
- export OS_UPDATE_SERVER=http://example.com
- export FW_UPDATE_SERVER=http://example.com
- export DB=postgresql
- export COVERALLS_REPO_TOKEN=lEX6nkql7y2YFCcIXVq5ORvdvMtYzfZdG
- bundle exec rspec --fail-fast=3
- npm run typecheck
- npm run test-slow
- npm run coverage

language: node_js
node_js:
- 8.9.4
cache:
  bundler: true
  yarn: true
  directories:
   - /home/travis/.rvm/
before_install:
  - rvm install 2.5.1
  - rvm use 2.5.1
before_script:
- sudo apt-get install curl -y
- mv node_modules/.bin/which node_modules/.bin/which.backup
- cp config/database.travis.yml config/database.yml
- bundle install --jobs=3 --retry=3
- bundle exec rake db:create db:migrate
- yarn install
script:
- export SECRET_TOKEN=e815982094c62436066bafc9151f2d33c4a351a776654cb7487476de260a4592
- export MQTT_HOST=example.com
- export OS_UPDATE_SERVER=http://example.com
- export FW_UPDATE_SERVER=http://example.com
- export DB=postgresql
- export COVERALLS_REPO_TOKEN=lEX6nkql7y2YFCcIXVq5ORvdvMtYzfZdG
- bundle exec rspec --fail-fast=3
- npm run typecheck
- npm run test-slow
- npm run coverage

Install RVM in the phase it would normally be installed in, and cache the install on Travis
Install RVM in the phase it would normally be installed in, and cache the install on Travis