File tree Expand file tree Collapse file tree 1 file changed +23
-6
lines changed
Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Original file line number Diff line number Diff line change 1- name : Go
1+ name : Go CI
22
33on :
44 push :
77 branches : [ main ]
88
99jobs :
10- build-and-test :
10+ ci :
1111 runs-on : ubuntu-latest
12+
1213 steps :
1314 - name : Checkout code
1415 uses : actions/checkout@v4
1516
1617 - name : Set up Go
1718 uses : actions/setup-go@v5
1819 with :
19- go-version : ' 1.22' # Adjust to match your go.mod
20+ go-version-file : go.mod
21+ cache : true
2022
21- - name : Install dependencies
22- run : go mod tidy
23+ # Ensures go.mod/go.sum are clean
24+ - name : Verify dependencies
25+ run : |
26+ go mod tidy
27+ git diff --exit-code
2328
2429 - name : Run tests
25- run : go test ./...
30+ run : |
31+ go test ./... -race -count=1
32+
33+ - name : Run tests with coverage
34+ run : |
35+ go test ./... -coverprofile=coverage.out
36+ go tool cover -func=coverage.out
37+
38+ - name : Lint
39+ uses : golangci/golangci-lint-action@v6
40+ with :
41+ version : latest
42+ args : --timeout=5m
You can’t perform that action at this time.
0 commit comments