Skip to content

Commit b3126bd

Browse files
authored
feat: migrate github actions (#41)
* Add GitHub Actions workflows for linting, testing, and releasing; update dependencies Signed-off-by: Bailin He <bahe@equinix.com> * Update GitHub Actions to use specific versions for linting, testing, and scanning Signed-off-by: Bailin He <bahe@equinix.com> --------- Signed-off-by: Bailin He <bahe@equinix.com>
1 parent 01e0b5e commit b3126bd

File tree

5 files changed

+125
-74
lines changed

5 files changed

+125
-74
lines changed

.buildkite/pipeline.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/main.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
5+
jobs:
6+
lint:
7+
name: 📎 lint
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: metal-toolbox/ci-toolbox/actions/golangci-lint@v0.0.1
11+
12+
test:
13+
name: 🧪 test
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: metal-toolbox/ci-toolbox/actions/setup-go@v0.0.1
17+
- name: tests
18+
run: go test -cover -race ./...
19+
20+
scan:
21+
name: 🔍 scan
22+
permissions:
23+
contents: read
24+
security-events: write
25+
uses: metal-toolbox/ci-toolbox/.github/workflows/trivy.yaml@v0.0.1
26+
with:
27+
scan-type: fs

.golangci.yml

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
1-
linters-settings:
2-
gofumpt:
3-
extra-rules: true
4-
timeout: 5m
5-
1+
version: "2"
62
linters:
73
enable:
8-
# default linters
9-
- errcheck
10-
- gosimple
11-
- govet
12-
- ineffassign
13-
- staticcheck
14-
- typecheck
15-
- unused
16-
17-
# additional linters
184
- bodyclose
5+
- err113
196
- gocritic
207
- gocyclo
21-
- goerr113
22-
- gofmt
23-
- gofumpt
24-
- goimports
25-
- gomnd
26-
- govet
8+
- gosec
279
- misspell
10+
- mnd
2811
- noctx
2912
- revive
30-
- stylecheck
13+
- staticcheck
3114
- whitespace
32-
- wsl
33-
34-
issues:
35-
exclude:
36-
# Default excludes from `golangci-lint run --help` with EXC0002 removed
37-
# EXC0001 errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
38-
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
39-
# EXC0002 golint: Annoying issue about not having a comment. The rare codebase has such comments
40-
# - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)
41-
# EXC0003 golint: False positive when tests are defined in package 'test'
42-
- func name will be used as test\.Test.* by other packages, and that stutters; consider calling this
43-
# EXC0004 govet: Common false positives
44-
- (possible misuse of unsafe.Pointer|should have signature)
45-
# EXC0005 staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore
46-
- ineffective break statement. Did you mean to break out of the outer loop
47-
# EXC0006 gosec: Too many false-positives on 'unsafe' usage
48-
- Use of unsafe calls should be audited
49-
# EXC0007 gosec: Too many false-positives for parametrized shell calls
50-
- Subprocess launch(ed with variable|ing should be audited)
51-
# EXC0008 gosec: Duplicated errcheck checks
52-
- (G104|G307)
53-
# EXC0009 gosec: Too many issues in popular repos
54-
- (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
55-
# EXC0010 gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)'
56-
- Potential file inclusion via variable
57-
exclude-use-default: false
15+
- wsl_v5
16+
exclusions:
17+
generated: lax
18+
rules:
19+
- path: (.+)\.go$
20+
text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
21+
- path: (.+)\.go$
22+
text: func name will be used as test\.Test.* by other packages, and that stutters; consider calling this
23+
- path: (.+)\.go$
24+
text: (possible misuse of unsafe.Pointer|should have signature)
25+
- path: (.+)\.go$
26+
text: ineffective break statement. Did you mean to break out of the outer loop
27+
- path: (.+)\.go$
28+
text: Use of unsafe calls should be audited
29+
- path: (.+)\.go$
30+
text: Subprocess launch(ed with variable|ing should be audited)
31+
- path: (.+)\.go$
32+
text: (G104|G307)
33+
- path: (.+)\.go$
34+
text: (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
35+
- path: (.+)\.go$
36+
text: Potential file inclusion via variable
37+
paths:
38+
- third_party$
39+
- builtin$
40+
- examples$
41+
formatters:
42+
enable:
43+
- gofmt
44+
- gofumpt
45+
- goimports
46+
settings:
47+
gofumpt:
48+
extra-rules: true
49+
goimports:
50+
local-prefixes:
51+
- go.metalkube.net/gov-slack-addon
52+
exclusions:
53+
generated: lax
54+
paths:
55+
- third_party$
56+
- builtin$
57+
- examples$

go.mod

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
module github.com/metal-toolbox/addonx
22

3-
go 1.20
3+
go 1.26
44

55
require (
66
github.com/gofrs/uuid v4.4.0+incompatible
7-
github.com/nats-io/nats-server/v2 v2.9.17
8-
github.com/nats-io/nats.go v1.27.0
9-
github.com/stretchr/testify v1.8.3
10-
go.uber.org/zap v1.24.0
7+
github.com/nats-io/nats-server/v2 v2.12.4
8+
github.com/nats-io/nats.go v1.48.0
9+
github.com/stretchr/testify v1.11.1
10+
go.uber.org/zap v1.27.1
1111
)
1212

1313
require (
14+
github.com/antithesishq/antithesis-sdk-go v0.5.0 // indirect
1415
github.com/davecgh/go-spew v1.1.1 // indirect
15-
github.com/klauspost/compress v1.16.6 // indirect
16-
github.com/minio/highwayhash v1.0.2 // indirect
17-
github.com/nats-io/jwt/v2 v2.4.1 // indirect
18-
github.com/nats-io/nkeys v0.4.4 // indirect
16+
github.com/google/go-tpm v0.9.8 // indirect
17+
github.com/klauspost/compress v1.18.4 // indirect
18+
github.com/minio/highwayhash v1.0.4-0.20251030100505-070ab1a87a76 // indirect
19+
github.com/nats-io/jwt/v2 v2.8.0 // indirect
20+
github.com/nats-io/nkeys v0.4.15 // indirect
1921
github.com/nats-io/nuid v1.0.1 // indirect
2022
github.com/pmezard/go-difflib v1.0.0 // indirect
2123
go.uber.org/atomic v1.11.0 // indirect
24+
go.uber.org/automaxprocs v1.6.0 // indirect
2225
go.uber.org/multierr v1.11.0 // indirect
23-
golang.org/x/crypto v0.10.0 // indirect
24-
golang.org/x/sys v0.9.0 // indirect
25-
golang.org/x/time v0.3.0 // indirect
26+
golang.org/x/crypto v0.48.0 // indirect
27+
golang.org/x/sys v0.41.0 // indirect
28+
golang.org/x/time v0.14.0 // indirect
2629
gopkg.in/yaml.v3 v3.0.1 // indirect
2730
)

go.sum

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,78 @@
1+
github.com/antithesishq/antithesis-sdk-go v0.5.0 h1:cudCFF83pDDANcXFzkQPUHHedfnnIbUO3JMr9fqwFJs=
2+
github.com/antithesishq/antithesis-sdk-go v0.5.0/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl3v2yvUZjmKncl7U91fup7E=
13
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
4+
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
25
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
36
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
47
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
58
github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
69
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
10+
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
11+
github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo=
12+
github.com/google/go-tpm v0.9.8/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY=
713
github.com/klauspost/compress v1.16.6 h1:91SKEy4K37vkp255cJ8QesJhjyRO0hn9i9G0GoUwLsk=
814
github.com/klauspost/compress v1.16.6/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
15+
github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c=
16+
github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
917
github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
1018
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
19+
github.com/minio/highwayhash v1.0.4-0.20251030100505-070ab1a87a76 h1:KGuD/pM2JpL9FAYvBrnBBeENKZNh6eNtjqytV6TYjnk=
20+
github.com/minio/highwayhash v1.0.4-0.20251030100505-070ab1a87a76/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ=
1121
github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4=
1222
github.com/nats-io/jwt/v2 v2.4.1/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI=
23+
github.com/nats-io/jwt/v2 v2.8.0 h1:K7uzyz50+yGZDO5o772eRE7atlcSEENpL7P+b74JV1g=
24+
github.com/nats-io/jwt/v2 v2.8.0/go.mod h1:me11pOkwObtcBNR8AiMrUbtVOUGkqYjMQZ6jnSdVUIA=
1325
github.com/nats-io/nats-server/v2 v2.9.17 h1:gFpUQ3hqIDJrnqog+Bl5vaXg+RhhYEZIElasEuRn2tw=
1426
github.com/nats-io/nats-server/v2 v2.9.17/go.mod h1:eQysm3xDZmIjfkjr7DuD9DjRFpnxQc2vKVxtEg0Dp6s=
27+
github.com/nats-io/nats-server/v2 v2.12.4 h1:ZnT10v2LU2Xcoiy8ek9X6Se4YG8EuMfIfvAEuFVx1Ts=
28+
github.com/nats-io/nats-server/v2 v2.12.4/go.mod h1:5MCp/pqm5SEfsvVZ31ll1088ZTwEUdvRX1Hmh/mTTDg=
1529
github.com/nats-io/nats.go v1.27.0 h1:3o9fsPhmoKm+yK7rekH2GtWoE+D9jFbw8N3/ayI1C00=
1630
github.com/nats-io/nats.go v1.27.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc=
31+
github.com/nats-io/nats.go v1.48.0 h1:pSFyXApG+yWU/TgbKCjmm5K4wrHu86231/w84qRVR+U=
32+
github.com/nats-io/nats.go v1.48.0/go.mod h1:iRWIPokVIFbVijxuMQq4y9ttaBTMe0SFdlZfMDd+33g=
1733
github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA=
1834
github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64=
35+
github.com/nats-io/nkeys v0.4.15 h1:JACV5jRVO9V856KOapQ7x+EY8Jo3qw1vJt/9Jpwzkk4=
36+
github.com/nats-io/nkeys v0.4.15/go.mod h1:CpMchTXC9fxA5zrMo4KpySxNjiDVvr8ANOSZdiNfUrs=
1937
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
2038
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
2139
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
40+
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
2241
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
2342
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
2443
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
2544
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
45+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
46+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
2647
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
2748
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
49+
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
50+
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
2851
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
52+
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
53+
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
2954
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
3055
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
3156
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
3257
go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
58+
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
59+
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
3360
golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM=
3461
golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
62+
golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
63+
golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos=
3564
golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
3665
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
3766
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
67+
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
68+
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
69+
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
3870
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
3971
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
72+
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
73+
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
4074
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
75+
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
4176
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
4277
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
4378
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

0 commit comments

Comments
 (0)