forked from scottohara/loot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
44 lines (36 loc) · 1.89 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
language: ruby
# Cache gems
cache:
bundler: true
directories:
- node_modules
addons:
chrome: stable
#firefox: latest
env:
global:
CC_TEST_REPORTER_ID=26c7e954fe6e83150931914578222587ebd90734aca877d04a1a75d2d7823e2e
before_install:
- nvm install # Install node version from .nvmrc
- 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:
- bundle install --without production --path=${BUNDLE_PATH:-vendor/bundle} # Install ruby gems, excluding production only gems such as unicorn (already present by default in Travis)
- npm install # Install npm dependencies
#- npm install karma-firefox-launcher codeclimate-test-reporter
# Setup the database
before_script: bundle exec rake db:create db:migrate
# Run the test suites
script:
- bundle exec rubocop -DESP # Backend linting
- bundle exec rake # Backend specs
#- npm test -- --browsers Firefox # Frontend specs
- npm test # Frontend linting & specs
# Pipe the coverage data to Code Climate
after_script:
- ./cc-test-reporter format-coverage -t simplecov -o coverage/codeclimate.backend.json coverage/backend/.resultset.json # Format backend coverage
- ./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.frontend.json coverage/frontend/lcov.info # Format frontend coverage
- ./cc-test-reporter sum-coverage coverage/codeclimate.*.json -p 2 # Sum both coverage parts into coverage/codeclimate.json
- if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter upload-coverage; fi # Upload coverage/codeclimate.json