File tree Expand file tree Collapse file tree 1 file changed +19
-43
lines changed Expand file tree Collapse file tree 1 file changed +19
-43
lines changed Original file line number Diff line number Diff line change 1
- name : Lint and Format
2
-
1
+ name : golangci-lint
3
2
on :
4
3
push :
5
- branches : [ main, develop ]
4
+ branches :
5
+ - main
6
+ - master
6
7
pull_request :
7
- branches : [ main ]
8
+
9
+ permissions :
10
+ contents : read
11
+ # Optional: allow read access to pull requests. Use with `only-new-issues` option.
12
+ # pull-requests: read
8
13
9
14
jobs :
10
- lint :
11
- name : Lint and Format
15
+ golangci :
16
+ name : lint
12
17
runs-on : ubuntu-latest
13
-
14
18
steps :
15
- - name : Check out code
16
- uses : actions/checkout@v4
17
-
18
- - name : Set up Go
19
- uses : actions/setup-go@v5
20
- with :
21
- go-version : ' 1.24'
22
-
23
- - name : Cache Go modules
24
- uses : actions/cache@v4
25
- with :
26
- path : ~/go/pkg/mod
27
- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28
- restore-keys : |
29
- ${{ runner.os }}-go-
30
-
31
- - name : Install dependencies
32
- run : make deps
33
-
34
- - name : Run format check
35
- run : |
36
- make fmt
37
- if [ -n "$(git status --porcelain)" ]; then
38
- echo "Code is not properly formatted. Run 'make fmt' and commit the changes."
39
- git diff
40
- exit 1
41
- fi
42
-
43
- - name : Run vet
44
- run : make vet
45
-
46
- - name : Run staticcheck
47
-
48
- with :
49
- version : " 2023.1.7"
50
- install-go : false
19
+ - uses : actions/checkout@v4
20
+ - uses : actions/setup-go@v5
21
+ with :
22
+ go-version : stable
23
+ - name : golangci-lint
24
+ uses : golangci/golangci-lint-action@v8
25
+ with :
26
+ version : v2.1
You can’t perform that action at this time.
0 commit comments