-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
executable file
·46 lines (41 loc) · 2.04 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
# replace with version(s) of Ruby that matches your Gemfile:
language: ruby
rvm:
- 2.5.3
# 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 > $CCTR
- chmod +x $CCTR
- $CCTR 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
- $CCTR format-coverage --output coverage/codeclimate.$SUITE.json
# - $CCTR format-coverage -d -t simplecov --output coverage/codeclimate.rspec.json --prefix /home/travis/build/zdehkordi/Project-Elevate
# run Cucumber scenarios, and capture coverage. --strict means undefined steps result in a failure.
- bundle exec cucumber --strict
# - $CCTR format-coverage --output coverage/codeclimate.$SUITE.json
after_script:
# combine coverage from all suites, and upload to CodeClimate
- $CCTR sum-coverage coverage/codeclimate.*.json | $CCTR upload-coverage
- $CCTR after-build --exit-code $TRAVIS_TEST_RESULT
# just in case, be paranoid and remove sensitive config info file
- rm -f config/application.yml