File tree Expand file tree Collapse file tree 2 files changed +70
-23
lines changed
Expand file tree Collapse file tree 2 files changed +70
-23
lines changed Original file line number Diff line number Diff line change 1+ name : Tests
2+
3+ on :
4+ push :
5+ pull_request :
6+
7+ jobs :
8+ test :
9+ strategy :
10+ # Default is true, cancels jobs for other platforms in the matrix if one fails
11+ fail-fast : false
12+ matrix :
13+ os : [ ubuntu-latest, macos-latest, windows-latest ]
14+ go : [ '1.15' ]
15+
16+ runs-on : ${{ matrix.os }}
17+
18+ steps :
19+ - name : Install Go
20+ uses : actions/setup-go@v2
21+ with :
22+ go-version : ${{ matrix.go }}
23+
24+ - name : Checkout code
25+ uses : actions/checkout@v2
26+
27+ - name : Print Go version and environment
28+ id : vars
29+ run : |
30+ printf "Using go at: $(which go)\n"
31+ printf "Go version: $(go version)\n"
32+ printf "\n\nGo environment:\n\n"
33+ go env
34+ printf "\n\nSystem environment:\n\n"
35+ env
36+ # Calculate the short SHA1 hash of the git commit
37+ echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
38+ echo "::set-output name=go_cache::$(go env GOCACHE)"
39+
40+ - name : Cache the build cache
41+ uses : actions/cache@v2
42+ with :
43+ path : ${{ steps.vars.outputs.go_cache }}
44+ key : ${{ runner.os }}-${{ matrix.go }}-go-ci-${{ hashFiles('**/go.sum') }}
45+ restore-keys : |
46+ ${{ runner.os }}-${{ matrix.go }}-go-ci
47+
48+ - name : Install dependencies
49+ run : |
50+ go mod download
51+
52+ - name : Run tests
53+ run : |
54+ ./cover.sh $HOME/build coverage.out
55+
56+ - uses : shogo82148/actions-goveralls@v1
57+ with :
58+ path-to-profile : coverage.out
59+
60+ golangci :
61+ name : Lint
62+
63+ runs-on : ubuntu-latest
64+
65+ steps :
66+ - uses : actions/checkout@v2
67+ - name : golangci-lint
68+ uses : golangci/golangci-lint-action@v2
69+ with :
70+ version : v1.31
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments