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 test
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ branches :
9+ - main
10+
11+ jobs :
12+ test :
13+ name : Go ${{ matrix.go-version }} Test
14+
15+ strategy :
16+ matrix :
17+ go-version : [1.16.x, 1.17.x]
18+ # platform: [ubuntu-latest, macos-latest, windows-latest]
19+ platform : [ubuntu-latest, macos-latest]
20+
21+ runs-on : ${{ matrix.platform }}
22+
23+ steps :
24+ - name : Set up Go ${{ matrix.go-version }}
25+ uses : actions/setup-go@v2
26+ with :
27+ go-version : ${{ matrix.go-version }}
28+ id : go
29+
30+ - name : Check out codes
31+ uses : actions/checkout@v2
32+
33+ - name : Cache modules
34+ uses : actions/cache@v2
35+ with :
36+ # In order:
37+ # * Module download cache
38+ # * Build cache (Linux)
39+ # * Build cache (Mac)
40+ # * Build cache (Windows)
41+ path : |
42+ ~/go/pkg/mod
43+ ~/.cache/go-build
44+ ~/Library/Caches/go-build
45+ %LocalAppData%\go-build
46+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
47+ restore-keys : |
48+ ${{ runner.os }}-go-
49+
50+ - name : Run lint
51+ uses : golangci/golangci-lint-action@v2
52+ with :
53+ version : v1.42
54+
55+ - name : Run tests
56+ run : go test ./...
You can’t perform that action at this time.
0 commit comments