forked from saasbook/MultiMeet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
50 lines (43 loc) · 2.35 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
50
# replace with version(s) of Ruby that matches your Gemfile:
language: ruby
rvm:
- 2.4.0
# make sure production-only gems are not installed
bundler_args: --without production
env:
global:
# in TravisCI settings, set CCKEY to your CodeClimate Test Reporter ID:
- CC_TEST_REPORTER_ID=$CCKEY
- CCTR=./cc-test-reporter
# set to whatever timezone your app assumes from this list:
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- TZ=America/Los_Angeles
# steps to run BEFORE the test run
before_script:
# create config/application.yml (sensitive API keys etc) from config/application.yml.asc
# IMPORTANT: you must MANUALLY set correct value of encryption KEY in Travis settings for your project --
# DO NOT expose that value here!
# - gpg --passphrase $KEY -d -o config/application.yml config/application.yml.asc
# install CodeClimate test reporter and tell it we are starting a test run
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
# setup the test database, including any seed data
# - bundle exec rake db:setup
# insert here any other steps needed (load other sample data, etc) before starting tests
# run RSpec tests, and capture coverage
- bundle exec rspec
- ./cc-test-reporter format-coverage -t simplecov --output coverage/codeclimate.$SUITE.json
# run Cucumber scenarios, and capture coverage. --strict means undefined steps result in a failure.
- bundle exec cucumber --strict
- ./cc-test-reporter format-coverage -t simplecov --output coverage/codeclimate.$SUITE.json
after_script:
# combine coverage from all suites, and upload to CodeClimate
# - ./cc-test-reporter sum-coverage -i coverage/codeclimate.*.json | ./cc-test-reporter upload-coverage
- ./cc-test-reporter sum-coverage coverage/codeclimate.*.json # Sum both coverage parts into coverage/codeclimate.json
- if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter upload-coverage -r $CC_TEST_REPORTER_ID; fi # Upload coverage/codeclimate.json
# after-build used only for single test suites
# - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT -r $CC_TEST_REPORTER_ID
# just in case, be paranoid and remove sensitive config info file
# - rm -f config/application.yml