Skip to content

Commit 817ac36

Browse files
authored
ci: use latest go version for unit testing cases of contribution components (#4062)
1 parent 92eab81 commit 817ac36

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

.github/workflows/ci-main.sh

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/usr/bin/env bash
22

3-
# Define the latest Go version requirement
4-
LATEST_GO_VERSION="1.23"
5-
63
coverage=$1
74

85
# find all path that contains go.mod.

.github/workflows/ci-main.yml

+14-7
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,21 @@ concurrency:
2828

2929
env:
3030
TZ: "Asia/Shanghai"
31-
31+
# for unit testing cases of some components that only execute on the latest go version.
32+
LATEST_GO_VERSION: "1.23"
3233

3334
jobs:
3435
code-test:
36+
strategy:
37+
matrix:
38+
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
39+
# When adding new go version to the list, make sure:
40+
# 1. Update the `LATEST_GO_VERSION` env variable.
41+
# 2. Update the `Report Coverage` action.
42+
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
43+
go-version: [ "1.20", "1.21", "1.22", "1.23" ]
44+
goarch: [ "386", "amd64" ]
45+
3546
runs-on: ubuntu-20.04
3647

3748
# Service containers to run with `code-test`
@@ -185,11 +196,6 @@ jobs:
185196
ports:
186197
- 2181:2181
187198

188-
strategy:
189-
matrix:
190-
go-version: [ "1.20", "1.21", "1.22", "1.23" ]
191-
goarch: [ "386", "amd64" ]
192-
193199
steps:
194200
# TODO: szenius/set-timezone update to node16
195201
# sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
@@ -256,7 +262,8 @@ jobs:
256262

257263
- name: Report Coverage
258264
uses: codecov/codecov-action@v4
259-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
265+
# Only report coverage on the latest go version and amd64 arch
266+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.go-version == '1.23' && matrix.goarch == 'amd64' }}
260267
with:
261268
flags: go-${{ matrix.go-version }}-${{ matrix.goarch }}
262269
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/ci-sub.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,22 @@ concurrency:
2929

3030
env:
3131
TZ: "Asia/Shanghai"
32-
32+
# for unit testing cases of some components that only execute on the latest go version.
33+
LATEST_GO_VERSION: "1.23"
3334

3435
jobs:
3536
code-test:
36-
runs-on: ubuntu-latest
37-
3837
strategy:
3938
matrix:
39+
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
40+
# When adding new go version to the list, make sure:
41+
# 1. Update the `LATEST_GO_VERSION` env variable.
42+
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
4043
go-version: [ "1.20", "1.21", "1.22", "1.23" ]
4144
goarch: [ "386", "amd64" ]
4245

46+
runs-on: ubuntu-latest
47+
4348
steps:
4449
- name: Setup Timezone
4550
uses: szenius/[email protected]

cmd/gf/go.work

-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ replace (
1616
github.com/gogf/gf/contrib/drivers/oracle/v2 => ../../contrib/drivers/oracle
1717
github.com/gogf/gf/contrib/drivers/pgsql/v2 => ../../contrib/drivers/pgsql
1818
github.com/gogf/gf/contrib/drivers/sqlite/v2 => ../../contrib/drivers/sqlite
19-
github.com/gogf/gf/contrib/drivers/dm/v2 => ../../contrib/drivers/dm
2019
github.com/gogf/gf/v2 => ../../
2120
)

0 commit comments

Comments
 (0)