Bump gorm.io/plugin/dbresolver from 1.4.1 to 1.4.5 #172
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- "main" | |
tags: | |
- "v*" | |
pull_request: | |
jobs: | |
postgres: | |
strategy: | |
matrix: | |
dbversion: | |
[ | |
"postgres:latest", | |
"postgres:13", | |
"postgres:12", | |
"postgres:11", | |
"postgres:10", | |
] | |
platform: [ubuntu-latest] # can not run in macOS and Windows | |
runs-on: ${{ matrix.platform }} | |
services: | |
postgres: | |
image: ${{ matrix.dbversion }} | |
env: | |
POSTGRES_DB: sharding-test | |
POSTGRES_USER: gorm | |
POSTGRES_PASSWORD: gorm | |
TZ: Asia/Shanghai | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
env: | |
DIALECTOR: postgres | |
DATABASE_URL: postgres://gorm:gorm@localhost:5432/sharding-test | |
DATABASE_READ_URL: postgres://gorm:gorm@localhost:5432/sharding-read-test | |
DATABASE_WRITE_URL: postgres://gorm:gorm@localhost:5432/sharding-write-test | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20" | |
id: go | |
- name: Create Read Database | |
run: PGPASSWORD=gorm psql -h localhost -U gorm -d sharding-test -c 'CREATE DATABASE "sharding-read-test";' | |
- name: Create Write Databases | |
run: PGPASSWORD=gorm psql -h localhost -U gorm -d sharding-test -c 'CREATE DATABASE "sharding-write-test";' | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
- name: Test | |
run: go test | |
mysql: | |
name: MySQL | |
strategy: | |
matrix: | |
dbversion: ["mysql:latest", "mysql:5.7"] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
services: | |
mysql: | |
image: ${{ matrix.dbversion }} | |
env: | |
MYSQL_DATABASE: sharding-test | |
MYSQL_USER: gorm | |
MYSQL_PASSWORD: gorm | |
MYSQL_ROOT_PASSWORD: gorm | |
ports: | |
- 3306:3306 | |
options: >- | |
--health-cmd "mysqladmin ping -ugorm -pgorm" | |
--health-interval 10s | |
--health-start-period 10s | |
--health-timeout 5s | |
--health-retries 10 | |
env: | |
DIALECTOR: mysql | |
DATABASE_URL: gorm:gorm@tcp(127.0.0.1:3306)/sharding-test?charset=utf8mb4&parseTime=True&loc=Local | |
DATABASE_READ_URL: root:gorm@tcp(127.0.0.1:3306)/sharding-read-test?charset=utf8mb4&parseTime=True&loc=Local | |
DATABASE_WRITE_URL: root:gorm@tcp(127.0.0.1:3306)/sharding-write-test?charset=utf8mb4&parseTime=True&loc=Local | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20" | |
id: go | |
- name: Create Read Database | |
run: mysqladmin -h 127.0.0.1 -uroot -pgorm create sharding-read-test | |
#run: mysql -e 'CREATE DATABASE sharding-read-test' -ugorm -pgorm | |
- name: Create Write Database | |
run: mysqladmin -h 127.0.0.1 -uroot -pgorm create sharding-write-test | |
#run: mysql -e 'CREATE DATABASE sharding-write-test' -ugorm -pgorm | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
- name: Test | |
run: go test | |
mariadb: | |
name: MariaDB | |
strategy: | |
matrix: | |
dbversion: ["mariadb:latest"] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
services: | |
mariadb: | |
image: ${{ matrix.dbversion }} | |
env: | |
MYSQL_DATABASE: sharding-test | |
MYSQL_USER: gorm | |
MYSQL_PASSWORD: gorm | |
MYSQL_ROOT_PASSWORD: gorm | |
ports: | |
- 3306:3306 | |
options: >- | |
--health-cmd "mysqladmin ping -ugorm -pgorm" | |
--health-interval 10s | |
--health-start-period 10s | |
--health-timeout 5s | |
--health-retries 10 | |
env: | |
DIALECTOR: mariadb | |
DATABASE_URL: gorm:gorm@tcp(127.0.0.1:3306)/sharding-test?charset=utf8mb4&parseTime=True&loc=Local | |
DATABASE_READ_URL: root:gorm@tcp(127.0.0.1:3306)/sharding-read-test?charset=utf8mb4&parseTime=True&loc=Local | |
DATABASE_WRITE_URL: root:gorm@tcp(127.0.0.1:3306)/sharding-write-test?charset=utf8mb4&parseTime=True&loc=Local | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20" | |
id: go | |
- name: Create Read Database | |
run: mysqladmin -h 127.0.0.1 -uroot -pgorm create sharding-read-test | |
#run: mysql -e 'CREATE DATABASE sharding-read-test' -ugorm -pgorm | |
- name: Create Write Database | |
run: mysqladmin -h 127.0.0.1 -uroot -pgorm create sharding-write-test | |
#run: mysql -e 'CREATE DATABASE sharding-write-test' -ugorm -pgorm | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
- name: Test | |
run: go test |