Skip to content

Commit 8ab969f

Browse files
authored
Merge branch 'gogf:master' into master
2 parents 688171a + 7443a8b commit 8ab969f

File tree

344 files changed

+24314
-5277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

344 files changed

+24314
-5277
lines changed

.github/workflows/gf.yml

+50-40
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ on:
66
branches:
77
- master
88
- develop
9+
- feature/**
10+
- fix/**
11+
912
pull_request:
1013
branches:
1114
- master
1215
- develop
13-
16+
- feature/**
17+
- fix/**
1418

1519
env:
1620
GF_DEBUG: 0
@@ -20,11 +24,11 @@ jobs:
2024
code-test:
2125
runs-on: ubuntu-latest
2226

23-
2427
# Service containers to run with `code-test`
2528
services:
29+
# Redis backend server.
2630
redis:
27-
image : redis
31+
image : loads/redis:latest
2832
options: >-
2933
--health-cmd "redis-cli ping"
3034
--health-interval 10s
@@ -34,17 +38,19 @@ jobs:
3438
# Maps tcp port 6379 on service container to the host
3539
- 6379:6379
3640

41+
# MySQL backend server.
3742
mysql:
38-
image: mysql:5.7
43+
image: loads/mysql:5.7
3944
env:
4045
MYSQL_DATABASE : test
4146
MYSQL_ROOT_PASSWORD: 12345678
4247
ports:
4348
# Maps tcp port 3306 on service container to the host
4449
- 3306:3306
4550

51+
# PostgreSQL backend server.
4652
postgres:
47-
image: postgres:13
53+
image: loads/postgres:13
4854
env:
4955
POSTGRES_PASSWORD: 12345678
5056
POSTGRES_USER: root
@@ -59,8 +65,9 @@ jobs:
5965
--health-timeout 5s
6066
--health-retries 5
6167
68+
# MSSQL backend server.
6269
mssql:
63-
image: mcmoe/mssqldocker:latest
70+
image: loads/mssqldocker:latest
6471
env:
6572
ACCEPT_EULA: Y
6673
SA_PASSWORD: LoremIpsum86
@@ -76,18 +83,37 @@ jobs:
7683
--health-timeout 5s
7784
--health-retries 10
7885
86+
# ClickHouse backend server.
7987
clickhouse-server:
80-
image: yandex/clickhouse-server
88+
image: loads/clickhouse-server:latest
8189
ports:
8290
- 9000:9000
8391
- 8123:8123
8492
- 9001:9001
8593

94+
polaris:
95+
image: polarismesh/polaris-server-standalone:latest
96+
ports:
97+
- 8090:8090
98+
- 8091:8091
99+
100+
#oracle 11g server
101+
oracle-server:
102+
image: loads/oracle-xe-11g-r2:latest
103+
env:
104+
ORACLE_ALLOW_REMOTE: true
105+
ORACLE_SID: XE
106+
ORACLE_DB_USER_NAME: system
107+
ORACLE_DB_PASSWORD: oracle
108+
ports:
109+
- 1521:1521
110+
111+
86112

87-
# strategy set
88113
strategy:
89114
matrix:
90-
go: ["1.15", "1.16", "1.17"]
115+
go: [ "1.15", "1.16", "1.17" ]
116+
goarch: [ "386", "amd64" ]
91117

92118

93119
steps:
@@ -111,46 +137,30 @@ jobs:
111137
echo "gofmt check pass."
112138
sudo echo "127.0.0.1 local" | sudo tee -a /etc/hosts
113139
114-
- name: CLI Build & Test
115-
run: |
116-
cd cmd/gf
117-
go mod tidy
118-
go build ./...
119-
go test ./...
120-
121-
- name: Example Build & Test
122-
run: |
123-
cd example
124-
go mod tidy
125-
go build ./...
126-
go test ./...
127-
128-
- name: Contrib Build & Test
140+
- name: Build & Test
129141
run: |
130-
cd contrib
142+
GOARCH=${{ matrix.goarch }}
131143
for file in `find . -name go.mod`; do
132-
path=$(dirname $file)
133-
# Ignore oracle database driver build&test.
134-
if [ "oracle" = $(basename $path) ]; then
135-
continue 1
144+
dirpath=$(dirname $file)
145+
146+
if [ "oracle" = $(basename $dirpath) ]; then
147+
if ! go version|grep -q "1.17"; then
148+
continue 1
149+
fi
136150
fi
137-
cd $path
151+
152+
cd $dirpath
138153
go mod tidy
139154
go build ./...
140-
go test ./...
155+
go test ./... -race -coverprofile=coverage.out -covermode=atomic -coverpkg=./...,github.com/gogf/gf/... || exit 1
156+
if grep -q "/gogf/gf/.*/v2" go.mod; then
157+
sed -i "s/gogf\/gf\(\/.*\)\/v2/gogf\/gf\/v2\1/g" coverage.out
158+
fi
141159
cd -
142160
done
143161
144-
- name: Run i386 Arch Test
145-
run: |
146-
GOARCH=386 go test -v ./... || exit 1
147-
148-
- name: Run amd64 Arch Test
149-
run: |
150-
GOARCH=amd64 go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic
151-
152162
- name: Report Coverage
153163
uses: codecov/codecov-action@v2
154164
with:
155-
flags: go-${{ matrix.go }}
165+
flags: go-${{ matrix.go }}-${{ matrix.goarch }}
156166

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ bin/
1414
cbuild
1515
**/.DS_Store
1616
.test/
17-
main
18-
gf
17+
cmd/gf/main
18+
go.work

0 commit comments

Comments
 (0)