-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (90 loc) · 2.47 KB
/
test.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Test
on:
push:
branches-ignore:
- master
jobs:
test-with-mysql:
strategy:
fail-fast: false
matrix:
ruby: ['3.1', '3.2', '3.3']
db_version: [8.0]
runs-on: ubuntu-latest
container:
image: ruby:${{ matrix.ruby }}
services:
db:
image: mysql:${{ matrix.db_version }}
env:
MYSQL_ROOT_PASSWORD: password
ports:
- 3306:3306
steps:
- uses: actions/checkout@v4
- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ matrix.ruby }}-mysql-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ matrix.ruby }}-mysql-
${{ matrix.ruby }}-
- name: Install & run tests
run: ./.github/actions/test-with-db.sh mysql
env:
DB_HOST: db
test-with-postgres:
strategy:
fail-fast: false
matrix:
ruby: ['3.1', '3.2', '3.3']
db_version: [14]
runs-on: ubuntu-latest
container:
image: ruby:${{ matrix.ruby }}
services:
db:
image: postgres:${{ matrix.db_version }}
env:
LANG: C.UTF-8
POSTGRES_INITDB_ARGS: --locale=C.UTF-8
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ matrix.ruby }}-postgres-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ matrix.ruby }}-postgres-
${{ matrix.ruby }}-
- name: Install & run tests
run: ./.github/actions/test-with-db.sh postgres
env:
DB_HOST: db
test-with-sqlite:
strategy:
fail-fast: false
matrix:
ruby: ['3.1', '3.2', '3.3']
runs-on: ubuntu-latest
container:
image: ruby:${{ matrix.ruby }}
steps:
- uses: actions/checkout@v4
- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ matrix.ruby }}-sqlite-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ matrix.ruby }}-sqlite-
${{ matrix.ruby }}-
- name: Install & run tests
run: ./.github/actions/test-with-db.sh sqlite