forked from lynndylanhurley/devise_token_auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
88 lines (81 loc) · 2.94 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
language: ruby
cache: bundler
services:
- mongodb
- mysql
- postgresql
bundler_args: --without development
rvm:
- 2.3.8
- 2.4.7
- 2.5.6
- 2.6.4
gemfile:
- gemfiles/rails_4_2.gemfile
- gemfiles/rails_5_0.gemfile
- gemfiles/rails_5_1.gemfile
- gemfiles/rails_5_2.gemfile
env:
global:
- RAILS_ENV=test
matrix:
- DB=sqlite
- DB=mysql
- DB=postgresql
matrix:
include:
- rvm: 2.3.8
gemfile: gemfiles/rails_4_2_mongoid_5.gemfile
env: DEVISE_TOKEN_AUTH_ORM=mongoid
- rvm: 2.3.8
gemfile: gemfiles/rails_5_1_mongoid_6.gemfile
env: DEVISE_TOKEN_AUTH_ORM=mongoid
- rvm: 2.4.7
gemfile: gemfiles/rails_5_1_mongoid_7.gemfile
env: DEVISE_TOKEN_AUTH_ORM=mongoid
- rvm: 2.5.6
gemfile: gemfiles/rails_5_2_mongoid_6.gemfile
env: DEVISE_TOKEN_AUTH_ORM=mongoid
- rvm: 2.5.6
gemfile: gemfiles/rails_5_2_mongoid_7.gemfile
env: DEVISE_TOKEN_AUTH_ORM=mongoid
- rvm: 2.6.4
gemfile: gemfiles/rails_5_2_mongoid_7.gemfile
env: DEVISE_TOKEN_AUTH_ORM=mongoid
- name: Code Climate Test Coverage
rmv: 2.5.6
env:
- CC_TEST_REPORTER_ID=44d7688de8e1b567b4af25ec5083c2cc0a355ab911192a7cbefd1ea25b2ffd3d
- GEMFILE_AR=gemfiles/rails_5_1.gemfile
- GEMFILE_MONGOID=gemfiles/rails_5_1_mongoid_7.gemfile
script:
- 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
# with ActiveRecord
- bundle install --jobs=3 --retry=3 --gemfile $GEMFILE_AR
- BUNDLE_GEMFILE=$GEMFILE_AR bundle exec rake --trace db:migrate
- BUNDLE_GEMFILE=$GEMFILE_AR bundle exec rake
- ./cc-test-reporter format-coverage -t simplecov -o coverage/codeclimate.active_record.json coverage/.resultset.json
# with Mongoid
- bundle install --jobs=3 --retry=3 --gemfile $GEMFILE_MONGOID
- BUNDLE_GEMFILE=$GEMFILE_MONGOID DEVISE_TOKEN_AUTH_ORM=mongoid bundle exec rake
- ./cc-test-reporter format-coverage -t simplecov -o coverage/codeclimate.mongoid.json coverage/.resultset.json
# merge test results
- if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then
./cc-test-reporter sum-coverage coverage/codeclimate.active_record.json coverage/codeclimate.mongoid.json;
./cc-test-reporter upload-coverage;
fi
exclude:
- rvm: 2.6.4
gemfile: gemfiles/rails_4_2.gemfile
fast_finish: true
before_install:
- "[[ $BUNDLE_GEMFILE == *rails_4_2* ]] && gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true"
- "[[ $BUNDLE_GEMFILE == *rails_4_2* ]] && gem install bundler -v '< 2' || true"
before_script:
- if [[ $DB == "mysql" ]]; then mysql -e 'create database devise_token_auth_test'; fi
- if [[ $DB == "postgresql" ]]; then psql -c 'create database devise_token_auth_test' -U postgres; fi
script:
- if [[ $DEVISE_TOKEN_AUTH_ORM == "" ]]; then bundle exec rake --trace db:migrate; fi
- bundle exec rake