@@ -2,13 +2,17 @@ name: CI
22
33on :
44 push :
5- branches : [ main, develop ]
5+ branches : [ master ]
66 pull_request :
7- branches : [ main, develop ]
7+ branches : [ master ]
88
99permissions :
1010 contents : read
1111
12+ concurrency :
13+ group : ci-${{ github.ref }}
14+ cancel-in-progress : true
15+
1216jobs :
1317 lint :
1418 runs-on : ubuntu-latest
@@ -22,28 +26,61 @@ jobs:
2226 with :
2327 go-version : ' 1.26.4'
2428
25- - name : Setup CI environment
26- run : ./scripts/ci-setup.sh
27-
2829 - name : Run golangci-lint
2930 uses : golangci/golangci-lint-action@d583c34f0599d37dbac4a198b9c83201be380893 # v9.3.0
3031 with :
3132 version : v2.12.2
3233
34+ checks :
35+ runs-on : ubuntu-latest
36+ permissions :
37+ contents : read
38+ steps :
39+ - uses : actions/checkout@v7
40+
41+ - name : Set up Go
42+ uses : actions/setup-go@v6
43+ with :
44+ go-version : ' 1.26.4'
45+
46+ - name : Check formatting
47+ run : |
48+ unformatted=$(gofmt -l .)
49+ if [ -n "$unformatted" ]; then
50+ echo "The following files are not gofmt-formatted:"
51+ echo "$unformatted"
52+ exit 1
53+ fi
54+
55+ - name : Verify go.mod/go.sum are tidy
56+ run : |
57+ go mod tidy
58+ git diff --exit-code go.mod go.sum
59+
60+ - name : go vet
61+ run : go vet ./...
62+
3363 test :
3464 runs-on : ubuntu-latest
3565 permissions :
3666 contents : read
3767 steps :
38- - uses : actions/checkout@v4
68+ - uses : actions/checkout@v7
3969
4070 - name : Set up Go
41- uses : actions/setup-go@v5
71+ uses : actions/setup-go@v6
4272 with :
43- go-version : ' 1.26.1 '
73+ go-version : ' 1.26.4 '
4474
4575 - name : Setup CI environment
4676 run : ./scripts/ci-setup.sh
4777
48- - name : Run tests
49- run : go test -v ./...
78+ - name : Run tests (race detector + coverage)
79+ run : go test -race -covermode=atomic -coverprofile=coverage.out ./...
80+
81+ - name : Upload coverage report
82+ uses : actions/upload-artifact@v4
83+ with :
84+ name : coverage
85+ path : coverage.out
86+ if-no-files-found : ignore
0 commit comments