Skip to content

Commit

Permalink
ci: use latest go version for unit testing cases of contribution comp…
Browse files Browse the repository at this point in the history
…onents (#4062)
  • Loading branch information
gqcn authored Dec 19, 2024
1 parent 92eab81 commit 817ac36
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci-main.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env bash

# Define the latest Go version requirement
LATEST_GO_VERSION="1.23"

coverage=$1

# find all path that contains go.mod.
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,21 @@ concurrency:

env:
TZ: "Asia/Shanghai"

# for unit testing cases of some components that only execute on the latest go version.
LATEST_GO_VERSION: "1.23"

jobs:
code-test:
strategy:
matrix:
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
# When adding new go version to the list, make sure:
# 1. Update the `LATEST_GO_VERSION` env variable.
# 2. Update the `Report Coverage` action.
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
go-version: [ "1.20", "1.21", "1.22", "1.23" ]
goarch: [ "386", "amd64" ]

runs-on: ubuntu-20.04

# Service containers to run with `code-test`
Expand Down Expand Up @@ -185,11 +196,6 @@ jobs:
ports:
- 2181:2181

strategy:
matrix:
go-version: [ "1.20", "1.21", "1.22", "1.23" ]
goarch: [ "386", "amd64" ]

steps:
# TODO: szenius/set-timezone update to node16
# sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
Expand Down Expand Up @@ -256,7 +262,8 @@ jobs:

- name: Report Coverage
uses: codecov/codecov-action@v4
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
# Only report coverage on the latest go version and amd64 arch
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.go-version == '1.23' && matrix.goarch == 'amd64' }}
with:
flags: go-${{ matrix.go-version }}-${{ matrix.goarch }}
token: ${{ secrets.CODECOV_TOKEN }}
11 changes: 8 additions & 3 deletions .github/workflows/ci-sub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,22 @@ concurrency:

env:
TZ: "Asia/Shanghai"

# for unit testing cases of some components that only execute on the latest go version.
LATEST_GO_VERSION: "1.23"

jobs:
code-test:
runs-on: ubuntu-latest

strategy:
matrix:
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
# When adding new go version to the list, make sure:
# 1. Update the `LATEST_GO_VERSION` env variable.
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
go-version: [ "1.20", "1.21", "1.22", "1.23" ]
goarch: [ "386", "amd64" ]

runs-on: ubuntu-latest

steps:
- name: Setup Timezone
uses: szenius/[email protected]
Expand Down
1 change: 0 additions & 1 deletion cmd/gf/go.work
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ replace (
github.com/gogf/gf/contrib/drivers/oracle/v2 => ../../contrib/drivers/oracle
github.com/gogf/gf/contrib/drivers/pgsql/v2 => ../../contrib/drivers/pgsql
github.com/gogf/gf/contrib/drivers/sqlite/v2 => ../../contrib/drivers/sqlite
github.com/gogf/gf/contrib/drivers/dm/v2 => ../../contrib/drivers/dm
github.com/gogf/gf/v2 => ../../
)

0 comments on commit 817ac36

Please sign in to comment.