1- ---
21name : CI
32
43on :
109 - master
1110
1211jobs :
13- rspec :
12+ test :
1413 runs-on : ubuntu-latest
14+
1515 services :
16- mysql :
17- image : mysql/mysql-server
18- ports :
19- - " 3306:3306"
20- env :
21- MYSQL_ROOT_PASSWORD : root
22- MYSQL_DATABASE : closure_tree_test
23- MYSQL_ROOT_HOST : ' %'
2416 postgres :
25- image : ' postgres'
26- ports : ['5432:5432']
17+ image : postgres:17-alpine
18+ ports :
19+ - 5432:5432
2720 env :
21+ POSTGRES_USER : postgres
2822 POSTGRES_PASSWORD : postgres
2923 POSTGRES_DB : closure_tree_test
3024 options : >-
3125 --health-cmd pg_isready
3226 --health-interval 10s
3327 --health-timeout 5s
3428 --health-retries 5
29+
30+ mysql :
31+ image : mysql:8
32+ ports :
33+ - 3306:3306
34+ env :
35+ MYSQL_DATABASE : closure_tree_test
36+ MYSQL_ROOT_PASSWORD : root
37+ options : >-
38+ --health-cmd="mysqladmin ping"
39+ --health-interval=10s
40+ --health-timeout=5s
41+ --health-retries=3
3542
3643 strategy :
3744 fail-fast : false
3845 matrix :
3946 ruby :
40- - ' 3.2'
41- - ' 3.1'
42- - ' 3.0'
43- - ' 2.7'
47+ - ' 3.4'
4448 rails :
45- - activerecord_7.0
46- - activerecord_6.1
47- - activerecord_6.0
48- adapter :
49- - ' sqlite3:///:memory:'
50- - mysql2://root:root@0/closure_tree_test
51- - postgres://closure_tree:closure_tree@0/closure_tree_test
49+ - ' 8.0'
5250
5351 steps :
5452 - name : Checkout
55- uses : actions/checkout@v3
53+ uses : actions/checkout@v4
5654
5755 - name : Setup Ruby
5856 uses : ruby/setup-ruby@v1
@@ -61,13 +59,25 @@ jobs:
6159 bundler-cache : true
6260 rubygems : latest
6361 env :
64- BUNDLE_GEMFILE : gemfiles/${{ matrix.rails }}.gemfile
62+ RAILS_VERSION : ${{ matrix.rails }}
63+ BUNDLE_GEMFILE : ${{ github.workspace }}/Gemfile
64+
65+ - name : Setup databases
66+ env :
6567 RAILS_ENV : test
68+ DATABASE_URL_PG : postgres://postgres:postgres@127.0.0.1:5432/closure_tree_test
69+ DATABASE_URL_MYSQL : mysql2://root:root@127.0.0.1:3306/closure_tree_test
70+ DATABASE_URL_SQLITE3 : ' sqlite3::memory:'
71+ run : |
72+ cd test/dummy
73+ bundle exec rails db:setup_all
6674
67- - name : RSpec
75+ - name : Run tests
6876 env :
69- RAILS_VERSION : ${{ matrix.rails }}
70- DB_ADAPTER : ${{ matrix.adapter }}
71- BUNDLE_GEMFILE : gemfiles/${{ matrix.rails }}.gemfile
77+ RAILS_ENV : test
78+ DATABASE_URL_PG : postgres://postgres:postgres@127.0.0.1:5432/closure_tree_test
79+ DATABASE_URL_MYSQL : mysql2://root:root@127.0.0.1:3306/closure_tree_test
80+ DATABASE_URL_SQLITE3 : ' sqlite3::memory:'
7281 WITH_ADVISORY_LOCK_PREFIX : ${{ github.run_id }}
73- run : bin/rake
82+ run : |
83+ bundle exec rake test
0 commit comments