Skip to content

Commit 350073d

Browse files
committed
Update actions and run pre-commit
1 parent 8a93600 commit 350073d

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

.github/workflows/go.yml

+14-11
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,29 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
go-version: ["1.21", "1.22"]
12+
name: Build ${{ matrix.go-version == '1.22' && '(latest)' || '(old)' }}
1213

1314
steps:
14-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1516

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
1819
with:
1920
go-version: ${{ matrix.go-version }}
2021

21-
- name: Install goimports
22-
run: |
23-
go install golang.org/x/tools/cmd/goimports@latest
24-
export PATH="$HOME/go/bin:$PATH"
25-
2622
- name: Build
2723
run: go build -v ./...
2824

2925
- name: Test
3026
run: go test -v ./...
3127

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

0 commit comments

Comments
 (0)