-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
49 lines (40 loc) · 2 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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