Skip to content

Commit de31358

Browse files
authored
chore: fix ci (#427)
* fix ci Signed-off-by: Huabing (Robin) Zhao <[email protected]> * fix lint Signed-off-by: Huabing (Robin) Zhao <[email protected]> * fix test Signed-off-by: Huabing (Robin) Zhao <[email protected]> --------- Signed-off-by: Huabing (Robin) Zhao <[email protected]>
1 parent 4f5a2b7 commit de31358

File tree

119 files changed

+155
-22796
lines changed

Some content is hidden

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

119 files changed

+155
-22796
lines changed

.github/workflows/ci.yaml

+7-5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
with:
2828
config_file: .ci/yamllint.yml
2929
strict: true
30+
file_or_dir: '.'
3031
build-and-test:
3132
name: build-and-test
3233
runs-on: ubuntu-latest
@@ -36,7 +37,7 @@ jobs:
3637
- name: Setup Go
3738
uses: actions/setup-go@v1
3839
with:
39-
go-version: '1.20'
40+
go-version: '1.24'
4041
- name: Build
4142
run: go build -race ./internal/...
4243
- name: Test
@@ -54,9 +55,9 @@ jobs:
5455
- name: Setup Go
5556
uses: actions/setup-go@v1
5657
with:
57-
go-version: '1.20'
58+
go-version: '1.24'
5859
- name: golangci-lint
59-
uses: golangci/golangci-lint-action@v3.7.0
60+
uses: golangci/golangci-lint-action@v7.0.0
6061
with:
6162
args: --timeout=10m --tests="false"
6263
style-check:
@@ -68,11 +69,12 @@ jobs:
6869
- name: Setup Go
6970
uses: actions/setup-go@v2
7071
with:
71-
go-version: '1.20'
72+
go-version: '1.24'
7273
- name: Install dependencies
7374
run: |
7475
go version
7576
go install golang.org/x/tools/cmd/goimports@latest
77+
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
7678
- name: gofmt and goimports
7779
run: make style-check
7880
checkgomod:
@@ -82,7 +84,7 @@ jobs:
8284
- uses: actions/checkout@v2
8385
- uses: actions/setup-go@v1
8486
with:
85-
go-version: '1.20'
87+
go-version: '1.24'
8688
- run: go mod tidy
8789
- name: Check for changes in go.mod or go.sum
8890
run: |

.github/workflows/e2e-metaprotocol-gateway.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup Go
3737
uses: actions/setup-go@v2
3838
with:
39-
go-version: '1.20'
39+
go-version: '1.24'
4040
- name: Install dependencies
4141
run: |
4242
go version

.github/workflows/e2e-metaprotocol.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup Go
3737
uses: actions/setup-go@v2
3838
with:
39-
go-version: '1.20'
39+
go-version: '1.24'
4040
- name: Install dependencies
4141
run: |
4242
go version
@@ -65,7 +65,7 @@ jobs:
6565
- name: Setup Go
6666
uses: actions/setup-go@v2
6767
with:
68-
go-version: '1.20'
68+
go-version: '1.24'
6969
- name: Install dependencies
7070
run: |
7171
go version
@@ -94,7 +94,7 @@ jobs:
9494
- name: Setup Go
9595
uses: actions/setup-go@v2
9696
with:
97-
go-version: '1.20'
97+
go-version: '1.24'
9898
- name: Install dependencies
9999
run: |
100100
go version
@@ -123,7 +123,7 @@ jobs:
123123
- name: Setup Go
124124
uses: actions/setup-go@v2
125125
with:
126-
go-version: '1.20'
126+
go-version: '1.24'
127127
- name: Install dependencies
128128
run: |
129129
go version
@@ -152,7 +152,7 @@ jobs:
152152
- name: Setup Go
153153
uses: actions/setup-go@v2
154154
with:
155-
go-version: '1.20'
155+
go-version: '1.24'
156156
- name: Install dependencies
157157
run: |
158158
go version
@@ -181,7 +181,7 @@ jobs:
181181
- name: Setup Go
182182
uses: actions/setup-go@v2
183183
with:
184-
go-version: '1.20'
184+
go-version: '1.24'
185185
- name: Install dependencies
186186
run: |
187187
go version
@@ -210,7 +210,7 @@ jobs:
210210
- name: Setup Go
211211
uses: actions/setup-go@v2
212212
with:
213-
go-version: '1.20'
213+
go-version: '1.24'
214214
- name: Install dependencies
215215
run: |
216216
go version
@@ -239,7 +239,7 @@ jobs:
239239
- name: Setup Go
240240
uses: actions/setup-go@v2
241241
with:
242-
go-version: '1.20'
242+
go-version: '1.24'
243243
- name: Install dependencies
244244
run: |
245245
go version
@@ -268,7 +268,7 @@ jobs:
268268
- name: Setup Go
269269
uses: actions/setup-go@v2
270270
with:
271-
go-version: '1.20'
271+
go-version: '1.24'
272272
- name: Install dependencies
273273
run: |
274274
go version

.github/workflows/e2e-redis.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup Go
3737
uses: actions/setup-go@v2
3838
with:
39-
go-version: '1.20'
39+
go-version: '1.24'
4040
- name: Install dependencies
4141
run: |
4242
go install golang.org/x/tools/cmd/goimports@latest

.golangci.yml

+84-101
Original file line numberDiff line numberDiff line change
@@ -13,114 +13,97 @@
1313
# limitations under the License.
1414

1515
---
16-
linters-settings:
17-
depguard:
18-
rules:
19-
Main:
20-
deny:
21-
- pkg: github.com/gogo/protobuf
22-
desc: "gogo/protobuf is deprecated, use golang/protobuf"
23-
- pkg: gopkg.in/yaml.v2
24-
desc: "use sigs.k8s.io/yaml instead"
25-
- pkg: gopkg.in/yaml.v3
26-
desc: "use sigs.k8s.io/yaml instead"
27-
dupl:
28-
threshold: 100
29-
funlen:
30-
lines: 80
31-
statements: 50
32-
goconst:
33-
min-len: 2
34-
min-occurrences: 3
35-
gocritic:
36-
enabled-tags:
37-
- diagnostic
38-
- experimental
39-
- opinionated
40-
- performance
41-
- style
42-
disabled-checks:
43-
- dupImport # https://github.com/go-critic/go-critic/issues/845
44-
- ifElseChain
45-
- octalLiteral
46-
- whyNoLint
47-
- wrapperFunc
48-
gocyclo:
49-
min-complexity: 15
50-
goimports:
51-
local-prefixes: github.com/aeraki-mesh/aeraki
52-
gomnd:
53-
# don't include the "operation" and "assign"
54-
checks:
55-
- argument
56-
- case
57-
- condition
58-
- return
59-
ignored-numbers:
60-
- '0'
61-
- '1'
62-
- '2'
63-
- '3'
64-
ignored-functions:
65-
- strings.SplitN
66-
67-
govet:
68-
check-shadowing: true
69-
settings:
70-
printf:
71-
funcs:
72-
lll:
73-
line-length: 120
74-
misspell:
75-
locale: US
76-
nolintlint:
77-
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
78-
allow-unused: false # report any unused nolint directives
79-
require-explanation: false # don't require an explanation for nolint directives
80-
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
81-
16+
version: "2"
8217
linters:
83-
disable-all: true
18+
default: none
8419
enable:
85-
- stylecheck
8620
- bodyclose
87-
- exportloopref
88-
- gofmt
89-
- goimports
90-
- goheader
9121
- gocritic
22+
- goheader
9223
- gosec
9324
- misspell
9425
- revive
26+
- staticcheck
9527
- unconvert
9628
- unparam
29+
settings:
30+
depguard:
31+
rules:
32+
Main:
33+
deny:
34+
- pkg: github.com/gogo/protobuf
35+
desc: gogo/protobuf is deprecated, use golang/protobuf
36+
- pkg: gopkg.in/yaml.v2
37+
desc: use sigs.k8s.io/yaml instead
38+
- pkg: gopkg.in/yaml.v3
39+
desc: use sigs.k8s.io/yaml instead
40+
dupl:
41+
threshold: 100
42+
funlen:
43+
lines: 80
44+
statements: 50
45+
goconst:
46+
min-len: 2
47+
min-occurrences: 3
48+
gocritic:
49+
disabled-checks:
50+
- dupImport
51+
- ifElseChain
52+
- octalLiteral
53+
- whyNoLint
54+
- wrapperFunc
55+
enabled-tags:
56+
- diagnostic
57+
- experimental
58+
- opinionated
59+
- performance
60+
- style
61+
gocyclo:
62+
min-complexity: 15
63+
govet:
64+
settings:
65+
printf:
66+
funcs: null
67+
lll:
68+
line-length: 120
69+
misspell:
70+
locale: US
71+
nolintlint:
72+
require-explanation: false
73+
require-specific: false
74+
allow-unused: false
75+
exclusions:
76+
generated: lax
77+
presets:
78+
- comments
79+
- common-false-positives
80+
- legacy
81+
- std-error-handling
82+
rules:
83+
- path: (.+)\.go$
84+
text: declaration of "(err|ctx)" shadows declaration at
85+
- path: (.+)\.go$
86+
text: shadow of imported from
87+
- path: (.+)\.go$
88+
text: 'singleCaseSwitch: should rewrite switch statement to if statement'
89+
paths:
90+
- third_party$
91+
- builtin$
92+
- examples$
93+
- test
9794

98-
# don't enable:
99-
# - asciicheck
100-
# - scopelint
101-
# - gochecknoglobals
102-
# - gocognit
103-
# - godot
104-
# - godox
105-
# - goerr113
106-
# - interfacer
107-
# - maligned
108-
# - nestif
109-
# - prealloc
110-
# - testpackage
111-
# - revive
112-
# - wsl
113-
114-
issues:
115-
exclude:
116-
- 'declaration of "(err|ctx)" shadows declaration at'
117-
- 'shadow of imported from'
118-
- "singleCaseSwitch: should rewrite switch statement to if statement"
119-
120-
run:
121-
timeout: 5m
122-
go: '1.17'
123-
skip-dirs:
124-
- api
125-
- client-go
126-
- test
95+
formatters:
96+
enable:
97+
- gofmt
98+
- goimports
99+
settings:
100+
goimports:
101+
local-prefixes:
102+
- github.com/aeraki-mesh/aeraki
103+
exclusions:
104+
generated: lax
105+
paths:
106+
- third_party$
107+
- builtin$
108+
- examples$
109+
- test

api/README.md

-3
This file was deleted.

0 commit comments

Comments
 (0)