File tree Expand file tree Collapse file tree 1 file changed +46
-4
lines changed Expand file tree Collapse file tree 1 file changed +46
-4
lines changed Original file line number Diff line number Diff line change 6
6
pull_request :
7
7
branches :
8
8
- master
9
+ concurrency :
10
+ group : ${{github.workflow}}-${{github.event.pull_request.number || github.ref}}
11
+ cancel-in-progress : true
9
12
jobs :
10
13
test :
11
14
runs-on : ubuntu-latest
12
15
strategy :
13
16
matrix :
14
- ruby :
15
- - ' 3.3'
16
- - ' 3.2'
17
- - ' 3.1'
17
+ ruby : ['3.3', '3.2', '3.1']
18
+ database : ['sqlite', 'postgres', 'mysql', 'mariadb']
19
+ services :
20
+ postgres :
21
+ image : postgres:15
22
+ ports :
23
+ - 5432:5432
24
+ env :
25
+ POSTGRES_USER : postgres
26
+ POSTGRES_PASSWORD : postgres
27
+ POSTGRES_DB : test
28
+ mysql :
29
+ image : mysql:8.0
30
+ ports :
31
+ - 3306:3306
32
+ env :
33
+ MYSQL_ROOT_PASSWORD : root
34
+ MYSQL_DATABASE : test
35
+ mariadb :
36
+ image : ' mariadb:11'
37
+ env :
38
+ MARIADB_ROOT_PASSWORD : root
39
+ MARIADB_DATABASE : test
40
+ ports :
41
+ - 3307:3306 # avoid conflict w/ mysql
18
42
steps :
19
43
- name : Checkout
20
44
uses : actions/checkout@v4
23
47
with :
24
48
ruby-version : ${{matrix.ruby}}
25
49
bundler-cache : true
50
+ - name : Setup database
51
+ run : |
52
+ case ${{matrix.database}} in
53
+ sqlite)
54
+ echo "DATABASE_URL=sqlite3::memory:" >> $GITHUB_ENV
55
+ ;;
56
+ postgres)
57
+ echo "DATABASE_URL=postgres://postgres:postgres@localhost/test" >> $GITHUB_ENV
58
+ ;;
59
+ mysql)
60
+ echo "DATABASE_URL=mysql2://root:root@127.0.0.1/test" >> $GITHUB_ENV
61
+ ;;
62
+ mariadb)
63
+ echo "DATABASE_URL=mysql2://root:root@127.0.0.1:3307/test" >> $GITHUB_ENV
64
+ ;;
65
+ esac
26
66
- name : Test
27
67
run : bundle exec rake test
68
+ # nothing but postgres is supported right now so we'll ignore failures
69
+ continue-on-error : ${{matrix.database != 'postgres'}}
You can’t perform that action at this time.
0 commit comments