File tree 1 file changed +14
-11
lines changed
1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change 9
9
fail-fast : false
10
10
matrix :
11
11
go-version : ["1.21", "1.22"]
12
+ name : Build ${{ matrix.go-version == '1.22' && '(latest)' || '(old)' }}
12
13
13
14
steps :
14
- - uses : actions/checkout@v2
15
+ - uses : actions/checkout@v4
15
16
16
- - name : Set up Go ${{ matrix.go-version }}
17
- uses : actions/setup-go@v2
17
+ - name : Set up Go
18
+ uses : actions/setup-go@v5
18
19
with :
19
20
go-version : ${{ matrix.go-version }}
20
21
21
- - name : Install goimports
22
- run : |
23
- go install golang.org/x/tools/cmd/goimports@latest
24
- export PATH="$HOME/go/bin:$PATH"
25
-
26
22
- name : Build
27
23
run : go build -v ./...
28
24
29
25
- name : Test
30
26
run : go test -v ./...
31
27
32
- - name : Format
33
- run : if [ "$(goimports -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
34
- if : matrix.go-version == 1.22
28
+ - name : Install goimports
29
+ run : |
30
+ go install golang.org/x/tools/cmd/goimports@latest
31
+ export PATH="$HOME/go/bin:$PATH"
32
+
33
+ - name : Install pre-commit
34
+ run : pip install pre-commit
35
+
36
+ - name : Lint
37
+ run : pre-commit run -a
You can’t perform that action at this time.
0 commit comments