-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
68 lines (60 loc) · 2.47 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
dist: bionic
language: ruby
sudo: false
cache:
bundler: true
directories:
- /home/travis/.rvm/gems
rvm:
- 2.7
- 3.0
env:
matrix:
- RAILS_VERSION=v6.1.0 TASK='db:mysql:rebuild mysql2:test'
- RAILS_VERSION=v6.1.0 TASK='db:mysql:rebuild mysql2:isolated_test'
- RAILS_VERSION=v6.1.0 TASK='db:postgresql:rebuild postgresql:test'
- RAILS_VERSION=v6.1.0 TASK='db:postgresql:rebuild postgresql:isolated_test'
- RAILS_VERSION=v6.1.0 TASK='sqlite3:test'
- RAILS_VERSION=v6.1.0 TASK='sqlite3:isolated_test'
- RAILS_VERSION=v6.1.0 TASK='sqlite3_mem:test'
services:
- mysql
addons:
postgresql: "13"
apt:
packages:
- postgresql-13
- postgresql-client-13
before_install:
- sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/13/main/postgresql.conf
- sudo cp /etc/postgresql/{9.3,13}/main/pg_hba.conf
- sudo pg_ctlcluster 13 main restart
- unset BUNDLE_GEMFILE
- gem update --system
- gem update bundler
- gem install bundler --version 1.17.3
- mysql -e "create user rails@localhost;"
- mysql -e "grant all privileges on activerecord_unittest.* to rails@localhost;"
- mysql -e "grant all privileges on activerecord_unittest2.* to rails@localhost;"
- mysql -e "grant all privileges on inexistent_activerecord_unittest.* to rails@localhost;"
- mysql -e "create database activerecord_unittest default character set utf8mb4;"
- mysql -e "create database activerecord_unittest2 default character set utf8mb4;"
install:
- git clone --branch $RAILS_VERSION https://github.com/rails/rails.git ~/build/rails
before_script:
- sed -i "s/t.warning = true/t.warning = false/g" Rakefile
- pushd ~/build/rails
- git status
- sed -i "s/Gem.ruby, '-w'/Gem.ruby, '-w0'/" ~/build/rails/activerecord/Rakefile
- sed -i "s/t.warning = true/t.warning = false/g" ~/build/rails/activerecord/Rakefile
- sed -i "/require 'support\/connection'/a \$LOAD_PATH.unshift\(File.expand_path\('~\/build\/malomalo\/activerecord-cached_at\/lib'\)\)\nrequire 'cached_at'" ~/build/rails/activerecord/test/cases/helper.rb
- cat ~/build/rails/Gemfile
- rm ~/build/rails/Gemfile.lock
- "sed -i \"/group :db do/a gem 'activerecord-cached_at', require: 'cached_at', path: File.expand_path\\('~\\/build\\/malomalo\\/activerecord-cached_at'\\)\" ~/build/rails/Gemfile"
- cat ~/build/rails/Gemfile
- bundle update --jobs=3 --retry=3
- popd
- bundle install --jobs=3 --retry=3
script:
- bundle exec rake test
- cd ~/build/rails/activerecord && bundle exec rake $TASK