Skip to content

Commit 2066138

Browse files
saeideeSaeid Saeidee
andauthored
ci: fix mariadb mysqladmin (go-gorm#6401)
Co-authored-by: Saeid Saeidee <[email protected]>
1 parent c2d571c commit 2066138

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

.github/workflows/tests.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
mysql:
4242
strategy:
4343
matrix:
44-
dbversion: ['mysql:latest', 'mysql:5.7', 'mariadb:latest']
44+
dbversion: ['mysql:latest', 'mysql:5.7']
4545
go: ['1.19', '1.18']
4646
platform: [ubuntu-latest]
4747
runs-on: ${{ matrix.platform }}
@@ -72,7 +72,6 @@ jobs:
7272
- name: Check out code into the Go module directory
7373
uses: actions/checkout@v3
7474

75-
7675
- name: go mod package cache
7776
uses: actions/cache@v3
7877
with:
@@ -82,6 +81,49 @@ jobs:
8281
- name: Tests
8382
run: GITHUB_ACTION=true GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True" ./tests/tests_all.sh
8483

84+
mariadb:
85+
strategy:
86+
matrix:
87+
dbversion: [ 'mariadb:latest' ]
88+
go: [ '1.19', '1.18' ]
89+
platform: [ ubuntu-latest ]
90+
runs-on: ${{ matrix.platform }}
91+
92+
services:
93+
mysql:
94+
image: ${{ matrix.dbversion }}
95+
env:
96+
MYSQL_DATABASE: gorm
97+
MYSQL_USER: gorm
98+
MYSQL_PASSWORD: gorm
99+
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
100+
ports:
101+
- 9910:3306
102+
options: >-
103+
--health-cmd "mariadb-admin ping -ugorm -pgorm"
104+
--health-interval 10s
105+
--health-start-period 10s
106+
--health-timeout 5s
107+
--health-retries 10
108+
109+
steps:
110+
- name: Set up Go 1.x
111+
uses: actions/setup-go@v4
112+
with:
113+
go-version: ${{ matrix.go }}
114+
115+
- name: Check out code into the Go module directory
116+
uses: actions/checkout@v3
117+
118+
- name: go mod package cache
119+
uses: actions/cache@v3
120+
with:
121+
path: ~/go/pkg/mod
122+
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('tests/go.mod') }}
123+
124+
- name: Tests
125+
run: GITHUB_ACTION=true GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True" ./tests/tests_all.sh
126+
85127
postgres:
86128
strategy:
87129
matrix:

0 commit comments

Comments
 (0)