1- ---
21name : CI
32
43on :
98 branches :
109 - master
1110
12-
1311jobs :
1412 test :
1513 runs-on : ubuntu-latest
14+
1615 services :
17- mysql :
18- image : mysql/mysql-server
19- ports :
20- - " 3306:3306"
21- env :
22- MYSQL_ROOT_PASSWORD : root
23- MYSQL_DATABASE : closure_tree_test
24- MYSQL_ROOT_HOST : ' %'
2516 postgres :
26- image : ' postgres'
27- ports : ['5432:5432']
17+ image : postgres:17-alpine
18+ ports :
19+ - 5432:5432
2820 env :
21+ POSTGRES_USER : postgres
2922 POSTGRES_PASSWORD : postgres
3023 POSTGRES_DB : closure_tree_test
3124 options : >-
3225 --health-cmd pg_isready
3326 --health-interval 10s
3427 --health-timeout 5s
3528 --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
3642
3743 strategy :
3844 fail-fast : false
3945 matrix :
4046 ruby :
41- - ' 3.3 '
47+ - ' 3.4 '
4248 rails :
43- - activerecord_8.0
44- - activerecord_7.2
45- - activerecord_7.1
46- - activerecord_edge
47- adapter :
48- - ' sqlite3:///:memory:'
49- - mysql2://root:root@0/closure_tree_test
50- - postgres://closure_tree:closure_tree@0/closure_tree_test
49+ - ' 8.0'
5150
5251 steps :
5352 - name : Checkout
54- uses : actions/checkout@v3
53+ uses : actions/checkout@v4
5554
5655 - name : Setup Ruby
5756 uses : ruby/setup-ruby@v1
@@ -60,14 +59,25 @@ jobs:
6059 bundler-cache : true
6160 rubygems : latest
6261 env :
63- BUNDLE_GEMFILE : gemfiles/${{ matrix.rails }}.gemfile
62+ RAILS_VERSION : ${{ matrix.rails }}
63+ BUNDLE_GEMFILE : ${{ github.workspace }}/Gemfile
64+
65+ - name : Setup databases
66+ env :
6467 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
6574
66- - name : Test
75+ - name : Run tests
6776 env :
6877 RAILS_ENV : test
69- RAILS_VERSION : ${{ matrix.rails }}
70- DB_ADAPTER : ${{ matrix.adapter }}
71- BUNDLE_GEMFILE : gemfiles/${{ matrix.rails }}.gemfile
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