Skip to content

Commit 7218573

Browse files
MagicalTuxclaude
andcommitted
update GitHub Actions: Go 1.24, ubuntu, goimports, go vet
- test.yml: update to Go 1.24, ubuntu-latest, actions/setup-go@v5, actions/checkout@v4, run tests with -race flag - gofmt.yml: replace third-party gofmt action with goimports check and add go vet job Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0c3a348 commit 7218573

2 files changed

Lines changed: 61 additions & 25 deletions

File tree

‎.github/workflows/gofmt.yml‎

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,49 @@
1-
name: Go-fmt
2-
on: push
1+
name: Lint
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- release/*
7+
pull_request:
8+
branches:
9+
- master
10+
311
jobs:
4-
gofmt:
5-
name: Go fmt project
12+
goimports:
13+
name: goimports
614
runs-on: ubuntu-latest
715
steps:
8-
- name: check out
9-
uses: actions/checkout@v3
10-
- name: go fmt project
11-
uses: Jerome1337/gofmt-action@v1.0.4
16+
- name: Set up Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: '1.24'
20+
21+
- name: Check out code
22+
uses: actions/checkout@v4
23+
24+
- name: Install goimports
25+
run: go install golang.org/x/tools/cmd/goimports@latest
26+
27+
- name: Check formatting
28+
run: |
29+
unformatted=$(goimports -l .)
30+
if [ -n "$unformatted" ]; then
31+
echo "The following files are not formatted:"
32+
echo "$unformatted"
33+
exit 1
34+
fi
35+
36+
govet:
37+
name: go vet
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Set up Go
41+
uses: actions/setup-go@v5
42+
with:
43+
go-version: '1.24'
44+
45+
- name: Check out code
46+
uses: actions/checkout@v4
47+
48+
- name: Run go vet
49+
run: go vet ./...

‎.github/workflows/test.yml‎

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Go Test
1+
name: Tests
22
on:
33
push:
44
branches:
@@ -9,25 +9,23 @@ on:
99
- master
1010

1111
jobs:
12-
build:
12+
test:
1313
name: Test
14-
runs-on: macOS-latest
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
go-version: ['1.24']
1518
steps:
16-
17-
- name: Set up Go 1.22
18-
uses: actions/setup-go@v3
19+
- name: Set up Go ${{ matrix.go-version }}
20+
uses: actions/setup-go@v5
1921
with:
20-
go-version: 1.22.2
21-
id: go
22-
23-
- name: Check out code into the Go module directory
24-
uses: actions/checkout@v3
22+
go-version: ${{ matrix.go-version }}
2523

26-
- name: Clean dependencies
27-
run: go clean --modcache
24+
- name: Check out code
25+
uses: actions/checkout@v4
2826

29-
- name: Get dependencies
30-
run: go mod tidy
27+
- name: Build
28+
run: go build ./...
3129

32-
- name: Run Tests
33-
run: make test_unit_race
30+
- name: Run tests
31+
run: go test -timeout 30m -race ./...

0 commit comments

Comments
 (0)