CI update

This commit is contained in:
John Guo
2022-02-08 23:52:29 +08:00
parent 0a6e4ebf18
commit d0cfeb2a8c

View File

@ -1,5 +1,6 @@
name: GoFrame CI
on:
push:
branches:
@ -10,12 +11,16 @@ on:
- master
- develop
env:
GF_DEBUG: 0
jobs:
code-test:
runs-on: ubuntu-latest
# Service containers to run with `code-test`
services:
redis:
@ -28,6 +33,7 @@ jobs:
ports:
# Maps tcp port 6379 on service container to the host
- 6379:6379
mysql:
image: mysql:5.7
env:
@ -37,11 +43,46 @@ jobs:
# Maps tcp port 3306 on service container to the host
- 3306:3306
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: 12345678
POSTGRES_USER: root
POSTGRES_DB: test
TZ: Asia/Shanghai
ports:
- 9920:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mssql:
image: mcmoe/mssqldocker:latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: 12345678
MSSQL_DB: test
MSSQL_USER: root
MSSQL_PASSWORD: 12345678
ports:
- 9930:1433
options: >-
--health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P root -l 30 -Q \"SELECT 1\" || exit 1"
--health-start-period 10s
--health-interval 10s
--health-timeout 5s
--health-retries 10
# strategy set
strategy:
matrix:
go: ["1.15", "1.16", "1.17"]
steps:
- name: Set Up Timezone
uses: szenius/set-timezone@v1.0
@ -81,7 +122,12 @@ jobs:
run: |
cd contrib
for file in `find . -name go.mod`; do
cd ${file%/*}
path=$(dirname $file)
# Ignore oracle database driver build&test.
if [ "oracle" = $(basename $path) ]; then
continue 1
fi
cd $path
go mod tidy
go build ./...
go test ./...