https://github.com/mooreryan/iroki
Raw File
Tip revision: 8115e87ea048a90d24e16fda6df7bd3f40a24332 authored by Ryan M. Moore on 10 April 2023, 16:40:55 UTC
Remove analytics
Tip revision: 8115e87
.travis.yml
language: ruby
rvm:
  - 2.6.0

env:
  global:
    CC_TEST_REPORTER_ID=0e2d8bcc6b4b9943c02f08bd1dc4d56af73c80b8ed997edc296fee0cb84b3a54

before_install:
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
  - chmod +x ./cc-test-reporter
  #- export DISPLAY=:99.0                # Display number for xvfb (for headless browser testing)
  #- sh -e /etc/init.d/xvfb start        # Start xvfb (for headless browser testing)

install:
  - npm i -g npm # update npm
  - npm install -g istanbul # need this for teaspoon coverage metrics
  - npm install -g coveralls # to send Istanbul metrics to coveralls
  - bundle install


# Setup the database
before_script:
  - bundle exec rake db:create --all
  - bundle exec rake db:migrate
  # Need to make a .env file because we read secret keys from there.
  - echo "DEVELOPMENT_KEY=$(rake secret)" > .env
  - echo "TEST_KEY=$(rake secret)" >> .env
  - echo "SECRET_KEY_BASE=$(rake secret)" >> .env
  - mkdir coverage_teaspoon simple_cov_output coverage_code_climate

# Run the test suites.  These are set up to make the files used in the after script.
script:
  - bundle exec teaspoon --coverage=default
  - bundle exec rspec

services:
  - postgresql
notifications:
  email: false


# Pipe the coverage data to Code Climate
after_script:
#  - cat coverage_teaspoon/default/lcov.info | /usr/local/lib/node_modules/coveralls/bin/coveralls.js # send the teaspoon/istanbul to coveralls.io
  - ./cc-test-reporter format-coverage -t cobertura -o coverage_code_climate/part_teaspoon.json coverage_teaspoon/default/cobertura-coverage.xml # convert the teaspoon
  - ./cc-test-reporter format-coverage -t simplecov -o coverage_code_climate/part_simplecov.json simple_cov_output/.resultset.json # and the simplecov
  - ./cc-test-reporter sum-coverage coverage_code_climate/part_*.json -p 2 -o coverage_code_climate/codeclimate.json # sum up the coverage output
  - ./cc-test-reporter upload-coverage -i coverage_code_climate/codeclimate.json # upload the results
back to top