-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
26 lines (25 loc) · 902 Bytes
/
.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
language: ruby
dist: trusty
rvm:
- 2.6.3
- 2.7
env:
- DB=mysql
- DB=postgresql
- DB=sqlite
before_install:
- gem install -N bundler
bundler_args: --without capistrano doc production --jobs 2
before_script:
- cp config/database.yml.travis config/database.yml
- sed -i 's/config.eager_load = .*/config.eager_load = true/' config/environments/test.rb
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database frab_test'; fi"
- sh -c "if [ '$DB' = 'postgresql' ]; then psql -c 'create database frab_test' -U postgres; fi"
script:
- RAILS_ENV=test bundle exec rails db:schema:load --trace
- mv db/schema.rb db/schema.rb.original
- RAILS_ENV=test bundle exec rails db:rollback STEP=9
- RAILS_ENV=test bundle exec rails db:migrate
- sh -c "[ '$DB' != 'sqlite' ] || diff db/schema.rb db/schema.rb.original "
- bundle exec rails db:test:prepare
- bundle exec rails test