Skip to content

Commit f67edd7

Browse files
committed
clean up ci, use go 1.24, apply best practices for ci and general clean up
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
1 parent d5d4efc commit f67edd7

File tree

8 files changed

+82
-16
lines changed

8 files changed

+82
-16
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ on:
1010
- .gitignore
1111
merge_group:
1212

13+
permissions: {}
14+
1315
jobs:
1416
lint:
1517
runs-on: ubuntu-latest
1618

19+
permissions:
20+
contents: read
21+
1722
env:
1823
GOPATH: /home/runner/go
1924

@@ -22,20 +27,21 @@ jobs:
2227
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2328
with:
2429
submodules: recursive
30+
persist-credentials: false
2531

2632
- name: Setup Go
2733
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
2834
with:
29-
go-version: '1.21'
35+
go-version-file: './.go-version'
3036
check-latest: true
3137

3238
- name: Format check
3339
run: make fmt
3440

3541
- name: golangci-lint
36-
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
42+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
3743
with:
38-
version: v1.59
44+
version: v2.2
3945
args: --build-tags testonly
4046

4147
- name: Check generated code

.github/workflows/codeql.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
schedule:
99
- cron: '21 6 * * 6'
1010

11+
12+
permissions: {}
13+
1114
jobs:
1215
analyze:
1316
name: Analyze (${{ matrix.language }})

.github/workflows/coverage.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,21 @@ on:
1313
- main
1414
merge_group:
1515

16+
17+
permissions: {}
18+
1619
jobs:
1720
coverage:
1821
runs-on: ubuntu-latest
1922

23+
permissions:
24+
contents: read
25+
2026
strategy:
2127
matrix:
2228
go-version:
23-
- '1.21'
24-
- '1.22'
29+
- '1.23'
30+
- '1.24'
2531

2632
env:
2733
GOPATH: /home/runner/go
@@ -31,6 +37,7 @@ jobs:
3137
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3238
with:
3339
submodules: recursive
40+
persist-credentials: false
3441

3542
- name: Setup Go
3643
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2

.github/workflows/dco_merge_group.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: DCO
22
on:
33
merge_group:
44

5+
permissions: {}
6+
57
jobs:
68
DCO:
79
runs-on: ubuntu-latest
810
if: ${{ github.actor != 'dependabot[bot]' }}
911
steps:
10-
- run: echo "dummy DCO workflow (it won't run any check actually) to trigger by merge_group in order to enable merge queue"
12+
- run: echo "dummy DCO workflow (it won't run any check actually) to trigger by merge_group in order to enable merge queue"

.go-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.24.4

.golangci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
version: "2"
2+
run:
3+
issues-exit-code: 1
4+
linters:
5+
enable:
6+
- asciicheck
7+
- errorlint
8+
- gocritic
9+
- gosec
10+
- importas
11+
- misspell
12+
- prealloc
13+
- revive
14+
- staticcheck
15+
- tparallel
16+
- unconvert
17+
- unparam
18+
- whitespace
19+
20+
exclusions:
21+
generated: lax
22+
presets:
23+
- comments
24+
- common-false-positives
25+
- legacy
26+
- std-error-handling
27+
rules:
28+
- linters:
29+
- errcheck
30+
- gosec
31+
path: _test\.go
32+
paths:
33+
- third_party$
34+
- builtin$
35+
- examples$
36+
issues:
37+
max-issues-per-linter: 0
38+
max-same-issues: 0
39+
uniq-by-line: false
40+
formatters:
41+
enable:
42+
- gofmt
43+
- goimports
44+
exclusions:
45+
generated: lax
46+
paths:
47+
- third_party$
48+
- builtin$
49+
- examples$

.goreleaser.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1+
version: 2
2+
13
before:
24
hooks:
35
- go mod tidy
6+
47
builds:
58
- env:
69
- CGO_ENABLED=0
710
goos:
811
- linux
912
- windows
1013
- darwin
11-
archives:
12-
- replacements:
13-
darwin: Darwin
14-
linux: Linux
15-
windows: Windows
16-
386: i386
17-
amd64: x86_64
14+
1815
checksum:
1916
name_template: 'checksums.txt'
17+
2018
snapshot:
21-
name_template: "{{ incpatch .Version }}-next"
19+
version_template: "{{ incpatch .Version }}-next"
20+
2221
changelog:
2322
sort: asc
2423
filters:

DEVELOPMENT.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You must install these tools:
1717
1. [`git`](https://help.github.com/articles/set-up-git/): For source control
1818

1919
1. [`go`](https://golang.org/doc/install): The language this SDK is built in.
20-
> **Note** Golang [version v1.18](https://golang.org/dl/) or higher is required.
20+
> **Note** Golang [version v1.23](https://golang.org/dl/) or higher is required.
2121
2222
1. [`make`](https://www.gnu.org/software/make/): not stricly required but handy to run
2323
tests with a single command.
@@ -85,4 +85,3 @@ To run all targets, before creating a commit:
8585
```shell
8686
make all
8787
```
88-

0 commit comments

Comments
 (0)