-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
58 lines (50 loc) · 1.74 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
55
56
57
58
sudo: false
language: ruby
rvm:
- 2.4.4
branches:
only:
- master
addons:
postgresql: "9.6"
apt:
sources:
- heroku
packages:
- heroku-toolbelt
bundler_args:
--without development production
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
- RACK_ENV=test
- CC_TEST_REPORTER_ID=4b6ed992c24fa35dd06ddd7f4a4f610c782e6de9fabfcc419aa756e3f8bce2f1
- RUBY_GC_MALLOC_LIMIT=90000000
cache: bundler
before_script:
- psql -c 'CREATE DATABASE mental_health_test;' -U postgres
- psql -c "CREATE USER mental WITH PASSWORD 'health';" -U postgres
- "gem update --system"
- 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
before_install:
- gem update bundler # ensure bundler up to date
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" # ensure bundle does not install docs
script:
- bundle exec rake --version
- RACK_ENV=test bundle exec rake db:migrate
- RACK_ENV=test bundle exec rake spec
- bundle exec rake bundle:audit
- bundle exec rubocop
- bundle exec ruby-audit check
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
- ./cc-test-reporter format-coverage -t simplecov -o coverage/codeclimate.backend.json coverage/backend/.resultset.json # Format backend coverage
- ./cc-test-reporter sum-coverage coverage/codeclimate.*.json -p 1 # Sum coverage parts into coverage/codeclimate.json (we have no front-end coverage)
- if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter upload-coverage; fi # Upload coverage/codeclimate.json
notifications:
email:
on_success: never
on_failure: change
on_start: false