Skip to content

Commit 2c8b3f6

Browse files
committed
Bump golang, enhance CI, add tidycheck and vet checks
1 parent 8956028 commit 2c8b3f6

6 files changed

Lines changed: 44 additions & 12 deletions

File tree

.github/workflows/go.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,45 @@ jobs:
1414
build:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818

1919
- name: Set up Go
20-
uses: actions/setup-go@v4
20+
uses: actions/setup-go@v5
2121
with:
22-
go-version: '1.21'
22+
go-version: '1.25'
2323

2424
- name: Build
2525
run: go build -v ./...
2626

27+
- name: Vet
28+
run: make vet
29+
30+
- name: go.mod is tidy
31+
run: make tidycheck
32+
2733
- name: Test
2834
run: make unittest
2935

36+
- name: Upload coverage
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: coverage
40+
path: coverage.out
41+
3042
- name: Run bash tests
3143
run: |
3244
make build
33-
bash tests/graceful_restart.sh
45+
bash tests/graceful_restart.sh
46+
47+
govulncheck:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v4
51+
- name: Set up Go
52+
uses: actions/setup-go@v5
53+
with:
54+
go-version: '1.25'
55+
- name: govulncheck
56+
run: |
57+
go install golang.org/x/vuln/cmd/govulncheck@latest
58+
govulncheck ./...

.github/workflows/linters.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: actions/setup-go@v5
1919
with:
20-
go-version: '1.23.0'
20+
go-version: '1.25'
2121
cache: false
2222
- name: go fmt check
2323
run: make fmtcheck
@@ -29,7 +29,7 @@ jobs:
2929
- uses: actions/checkout@v4
3030
- uses: actions/setup-go@v5
3131
with:
32-
go-version: '1.23.0'
32+
go-version: '1.25'
3333
cache: false
3434
- name: golangci-lint
3535
uses: golangci/golangci-lint-action@v7

.github/workflows/regress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414

1515
- name: Regression tests
1616
run: make regress

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
steps:
1212

1313
- name: Set up Go 1.x
14-
uses: actions/setup-go@v4
14+
uses: actions/setup-go@v5
1515
with:
16-
go-version: 1.21
16+
go-version: '1.25'
1717
id: go
1818

1919
- name: Check out code into the Go module directory
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121

2222
- name: Get dependencies
2323
run:

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: docker/setup-buildx-action@v2
2020

2121
- name: Check out code
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323
with:
2424
repository: open-gpdb/gpdb
2525
ref: OPENGPDB_STABLE

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,18 @@ build:
1414
####################### TESTS #######################
1515

1616
unittest:
17-
go test -race ./pkg/message/... ./pkg/proc/... ./pkg/core/... ./pkg/storage/...
17+
go test -race -coverprofile=coverage.out -covermode=atomic ./pkg/... ./config/...
1818

1919
xproto:
2020
go test -race -tags xproto ./test/xproto/...
2121

22+
vet:
23+
go vet `go list ./... | grep -v /pkg/core/parser`
24+
25+
tidycheck:
26+
go mod tidy
27+
git diff --exit-code -- go.mod go.sum
28+
2229
regress:
2330
docker compose -f test/regress/docker-compose.yaml down
2431
docker compose -f test/regress/docker-compose.yaml run --remove-orphans --build yproxy

0 commit comments

Comments
 (0)