forked from mirror/gorm
Change default postgres DSN for github action
This commit is contained in:
parent
2d945a9641
commit
8100ac7663
|
@ -139,7 +139,7 @@ jobs:
|
||||||
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('tests/go.mod') }}
|
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('tests/go.mod') }}
|
||||||
|
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: GORM_DIALECT=postgres GORM_DSN="user=gorm password=gorm DB.name=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai" ./tests/tests_all.sh
|
run: GORM_DIALECT=postgres GORM_DSN="user=gorm password=gorm DB.name=gorm host=localhost port=9920 sslmode=disable TimeZone=Asia/Shanghai" ./tests/tests_all.sh
|
||||||
|
|
||||||
sqlserver:
|
sqlserver:
|
||||||
strategy:
|
strategy:
|
||||||
|
|
|
@ -52,7 +52,7 @@ func OpenTestConnection() (db *gorm.DB, err error) {
|
||||||
case "postgres":
|
case "postgres":
|
||||||
log.Println("testing postgres...")
|
log.Println("testing postgres...")
|
||||||
if dbDSN == "" {
|
if dbDSN == "" {
|
||||||
dbDSN = "user=gorm password=gorm DB.name=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai"
|
dbDSN = "user=gorm password=gorm DB.name=gorm host=localhost port=9920 sslmode=disable TimeZone=Asia/Shanghai"
|
||||||
}
|
}
|
||||||
db, err = gorm.Open(postgres.New(postgres.Config{
|
db, err = gorm.Open(postgres.New(postgres.Config{
|
||||||
DSN: dbDSN,
|
DSN: dbDSN,
|
||||||
|
|
Loading…
Reference in New Issue