mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
ci: use latest go version for unit testing cases of contribution components (#4062)
This commit is contained in:
3
.github/workflows/ci-main.sh
vendored
3
.github/workflows/ci-main.sh
vendored
@ -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.
|
||||
|
||||
21
.github/workflows/ci-main.yml
vendored
21
.github/workflows/ci-main.yml
vendored
@ -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`
|
||||
@ -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
|
||||
@ -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
.github/workflows/ci-sub.yml
vendored
11
.github/workflows/ci-sub.yml
vendored
@ -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/set-timezone@v2.0
|
||||
|
||||
@ -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 => ../../
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user