language: ruby
sudo: false
cache:
  bundler: true
  directories:
    - node_modules
    - client/node_modules
rvm:
  - 2.3.1
script:
  - npm run build:test
  - bundle exec rake parallel:spec[1]
  - bash <(curl -s https://codecov.io/bash) -cF rspec -f coverage/coverage.json
  - npm run jest:coverage
  - bash <(curl -s https://codecov.io/bash) -cF jest
  - bundle exec brakeman -z
  - bundle exec teaspoon
before_script:
  - cp config/database.yml.travis config/database.yml
  - bundle exec rake parallel:create[1]
  - bundle exec rake parallel:load_structure[1]
  - nvm install 7.5.0
  - npm install  # Make use of 'postinstall' to run 'cd ./client npm install'
addons:
  postgresql: "10"
  apt:
    packages:
      - postgresql-10
      - postgresql-client-10
  code_climate:
    repo_token: 284c330b001fc405fe9b1c8a013ebaed90e6f81b0318b2e3d0df66559dd0eb3e
env:
  global:
    - PGPORT=5433
    - PROGRESS_REPORT_FOG_DIRECTORY=empirical-progress-report-travis-test
    - FOG_DIRECTORY=empirical-core-travis-test

language: ruby
sudo: false
cache:
  bundler: true
  directories:
    - node_modules
    - client/node_modules
rvm:
  - 2.3.1
script:
  - npm run build:test
  - bundle exec rake parallel:spec[1]
  - sudo /etc/init.d/postgresql stop
  - bash <(curl -s https://codecov.io/bash) -cF rspec -f coverage/coverage.json
  - npm run jest:coverage
  - bash <(curl -s https://codecov.io/bash) -cF jest
  - bundle exec brakeman -z
  - bundle exec teaspoon
before_script:
  - cp config/database.yml.travis config/database.yml
  - bundle exec rake parallel:create[1]
  - bundle exec rake parallel:load_structure[1]
  - nvm install 7.5.0
  - npm install  # Make use of 'postinstall' to run 'cd ./client npm install'
addons:
  postgresql: "10"
  apt:
    packages:
      - postgresql-10
      - postgresql-client-10
  code_climate:
    repo_token: 284c330b001fc405fe9b1c8a013ebaed90e6f81b0318b2e3d0df66559dd0eb3e
env:
  global:
    - PGPORT=5433
    - PROGRESS_REPORT_FOG_DIRECTORY=empirical-progress-report-travis-test
    - FOG_DIRECTORY=empirical-core-travis-test

Stop postgresql after rspec tests run in CI
Stop postgresql after rspec tests run in CI
