File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+
13+ strategy :
14+ matrix :
15+ go-version : ["1.20", "1.24"]
16+
17+ steps :
18+ - uses : actions/checkout@v4
19+
20+ - name : Set up Go
21+ uses : actions/setup-go@v4
22+ with :
23+ go-version : ${{ matrix.go-version }}
24+
25+ - name : Cache Go modules
26+ uses : actions/cache@v3
27+ with :
28+ path : ~/go/pkg/mod
29+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
30+ restore-keys : |
31+ ${{ runner.os }}-go-
32+
33+ - name : Download dependencies
34+ run : go mod download
35+
36+ - name : Verify dependencies
37+ run : go mod verify
38+
39+ - name : Run tests
40+ run : go test -v ./...
41+
42+ - name : Check formatting
43+ run : |
44+ if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
45+ echo "Code is not formatted properly:"
46+ gofmt -s -l .
47+ exit 1
48+ fi
49+
50+ - name : Run go vet
51+ run : go vet ./...
52+
53+ - name : Run staticcheck
54+ uses : dominikh/staticcheck-action@v1
55+ with :
56+ version : " latest"
You can’t perform that action at this time.
0 commit comments