forked from saasbook/Berkeley-Student-Food-Collective
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
54 lines (45 loc) · 1.91 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
51
52
53
54
language: ruby
rvm:
- 2.4.0
bundler_args: --without production
cache: bundler
services: postgresql
addons:
firefox: latest
env:
global:
# in TravisCI settings, set CCKEY to your CodeClimate Test Reporter ID:
- CC_TEST_REPORTER_ID=7d5540307d57c3f4d6378f0f62b4051db7ada3c91892e35301200a27081a683b
- 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
- MOZ_HEADLESS=1
before_install:
- gem update --system
- gem install bundler:1.16.6
before_script:
# 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
- psql -c "create database bsfc_test;" -U postgres
- psql -c "create user bsfcuser;" -U postgres
- psql -c "alter user bsfcuser with superuser;" -U postgres
- gpg --passphrase "$MAPKEY" --output config/application.yml --decrypt config/application.yml.asc
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 -t simplecov
# 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 -t simplecov
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