workflow updates

This commit is contained in:
John Guo
2022-05-11 13:58:04 +08:00
parent 9c42ba187d
commit ead284e20b

View File

@ -23,9 +23,9 @@ jobs:
code-test:
runs-on: ubuntu-latest
# Service containers to run with `code-test`
services:
# Redis backend server.
redis:
image : redis
options: >-
@ -37,6 +37,7 @@ jobs:
# Maps tcp port 6379 on service container to the host
- 6379:6379
# MySQL backend server.
mysql:
image: mysql:5.7
env:
@ -46,6 +47,7 @@ jobs:
# Maps tcp port 3306 on service container to the host
- 3306:3306
# PostgreSQL backend server.
postgres:
image: postgres:13
env:
@ -62,6 +64,7 @@ jobs:
--health-timeout 5s
--health-retries 5
# MSSQL backend server.
mssql:
image: mcmoe/mssqldocker:latest
env:
@ -79,6 +82,7 @@ jobs:
--health-timeout 5s
--health-retries 10
# ClickHouse backend server.
clickhouse-server:
image: yandex/clickhouse-server
ports:
@ -87,7 +91,6 @@ jobs:
- 9001:9001
# strategy set
strategy:
matrix:
go: ["1.15", "1.16", "1.17"]
@ -120,7 +123,7 @@ jobs:
go mod tidy
go build ./...
GOARCH=386 go test ./... || exit 1
GOARCH=amd64 go test ./... -race -coverprofile=coverage.txt -covermode=atomic || exit 1
GOARCH=amd64 go test ./... -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,github.com/gogf/gf/v2/... || exit 1
- name: Example Build & Test
run: |
@ -128,7 +131,7 @@ jobs:
go mod tidy
go build ./...
GOARCH=386 go test ./... || exit 1
GOARCH=amd64 go test ./... -race -coverprofile=coverage.txt -covermode=atomic || exit 1
GOARCH=amd64 go test ./... -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,github.com/gogf/gf/v2/... || exit 1
- name: Contrib Build & Test
run: |
@ -143,7 +146,7 @@ jobs:
go mod tidy
go build ./...
GOARCH=386 go test ./... || exit 1
GOARCH=amd64 go test ./... -race -coverprofile=coverage.txt -covermode=atomic || exit 1
GOARCH=amd64 go test ./... -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,github.com/gogf/gf/v2/... || exit 1
cd -
done
@ -151,17 +154,17 @@ jobs:
run: |
go build ./...
GOARCH=386 go test -v ./... || exit 1
GOARCH=amd64 go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic || exit 1
GOARCH=amd64 go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,github.com/gogf/gf/v2/... || exit 1
- name: Merge Coverage
run: |
for file in `find . -name coverage.txt`; do
# In case of recursively incremental selffile in root directory.
if [ "./coverage.txt" = $file ]; then
continue 1
fi
cat $file >> coverage.txt
done
# - name: Merge Coverage
# run: |
# for file in `find . -name coverage.txt`; do
# # In case of recursively incremental selffile in root directory.
# if [ "./coverage.txt" = $file ]; then
# continue 1
# fi
# cat $file >> coverage.txt
# done
- name: Report Coverage
uses: codecov/codecov-action@v2