Skip to content

Commit

Permalink
ci: fix mariadb mysqladmin (go-gorm#6401)
Browse files Browse the repository at this point in the history
Co-authored-by: Saeid Saeidee <s.saeidee@sensysgatso.com>
  • Loading branch information
saeidee and Saeid Saeidee committed Jun 10, 2023
1 parent c2d571c commit 2066138
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
mysql:
strategy:
matrix:
dbversion: ['mysql:latest', 'mysql:5.7', 'mariadb:latest']
dbversion: ['mysql:latest', 'mysql:5.7']
go: ['1.19', '1.18']
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
Expand Down Expand Up @@ -72,7 +72,6 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v3


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

mariadb:
strategy:
matrix:
dbversion: [ 'mariadb:latest' ]
go: [ '1.19', '1.18' ]
platform: [ ubuntu-latest ]
runs-on: ${{ matrix.platform }}

services:
mysql:
image: ${{ matrix.dbversion }}
env:
MYSQL_DATABASE: gorm
MYSQL_USER: gorm
MYSQL_PASSWORD: gorm
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
ports:
- 9910:3306
options: >-
--health-cmd "mariadb-admin ping -ugorm -pgorm"
--health-interval 10s
--health-start-period 10s
--health-timeout 5s
--health-retries 10
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: go mod package cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('tests/go.mod') }}

- name: Tests
run: GITHUB_ACTION=true GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True" ./tests/tests_all.sh

postgres:
strategy:
matrix:
Expand Down

0 comments on commit 2066138

Please sign in to comment.