Skip to content

Commit 7fc3166

Browse files
authored
Merge pull request #1192 from yahonda/rails_master
Allow Ransack to be tested with Rails main branch
2 parents 06421f7 + 5a861da commit 7fc3166

File tree

5 files changed

+109
-1
lines changed

5 files changed

+109
-1
lines changed

.github/workflows/cronjob.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: cronjob
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
jobs:
8+
sqlite3:
9+
runs-on: ubuntu-20.04
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
ruby:
14+
- 3.0.0
15+
- 2.7.2
16+
- 2.6.6
17+
env:
18+
DB: sqlite3
19+
RAILS: main
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Ruby
23+
uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: ${{ matrix.ruby }}
26+
- name: Install dependencies
27+
run: bundle install
28+
- name: Run tests
29+
run: bundle exec rspec
30+
31+
mysql:
32+
runs-on: ubuntu-20.04
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
ruby:
37+
- 3.0.0
38+
- 2.7.2
39+
- 2.6.6
40+
env:
41+
DB: mysql
42+
RAILS: main
43+
MYSQL_USERNAME: root
44+
MYSQL_PASSWORD: root
45+
steps:
46+
- uses: actions/checkout@v2
47+
- name: Set up Ruby
48+
uses: ruby/setup-ruby@v1
49+
with:
50+
ruby-version: ${{ matrix.ruby }}
51+
- name: Startup MySQL
52+
run: |
53+
sudo systemctl start mysql.service
54+
- name: Setup databases
55+
run: |
56+
mysql --user=root --password=root --host=127.0.0.1 -e 'create database ransack collate utf8_general_ci;';
57+
mysql --user=root --password=root --host=127.0.0.1 -e 'use ransack;show variables like "%character%";show variables like "%collation%";';
58+
- name: Install dependencies
59+
run: bundle install
60+
- name: Run tests
61+
run: bundle exec rspec
62+
63+
postgres:
64+
runs-on: ubuntu-20.04
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
ruby:
69+
- 3.0.0
70+
- 2.7.2
71+
- 2.6.6
72+
env:
73+
DB: postgres
74+
RAILS: main
75+
DATABASE_USERNAME: postgres
76+
DATABASE_PASSWORD: postgres
77+
DATABASE_HOST: 127.0.0.1
78+
services:
79+
postgres:
80+
image: postgres
81+
ports:
82+
- 5432:5432
83+
env:
84+
POSTGRES_PASSWORD: postgres
85+
POSTGRES_HOST_AUTH_METHOD: trust
86+
# Set health checks to wait until postgres has started
87+
options: >-
88+
--health-cmd pg_isready
89+
--health-interval 10s
90+
--health-timeout 5s
91+
--health-retries 5
92+
93+
steps:
94+
- uses: actions/checkout@v2
95+
- name: Set up Ruby
96+
uses: ruby/setup-ruby@v1
97+
with:
98+
ruby-version: ${{ matrix.ruby }}
99+
- name: Setup databases
100+
run: |
101+
psql -h localhost -p 5432 -W postgres -c 'create database ransack;' -U postgres;
102+
- name: Install dependencies
103+
run: bundle install
104+
- name: Run tests
105+
run: bundle exec rspec

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ rails_version = case rails
1515
end
1616

1717
gem 'faker', '~> 2.0'
18-
gem 'sqlite3', ::Gem::Version.new(rails_version) >= ::Gem::Version.new('6-0-stable') ? '~> 1.4.1' : '~> 1.3.3'
18+
gem 'sqlite3', ::Gem::Version.new(rails_version == 'main' ? '6.2.0.alpha' : rails_version) >= ::Gem::Version.new('6-0-stable') ? '~> 1.4.1' : '~> 1.3.3'
1919
gem 'pg', '~> 1.0'
2020
gem 'pry', '~> 0.12.2'
2121
gem 'byebug'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'polyamorous/activerecord_6.1_ruby_2/join_association'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'polyamorous/activerecord_6.1_ruby_2/join_dependency'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'polyamorous/activerecord_6.1_ruby_2/reflection'

0 commit comments

Comments
 (0)