File tree Expand file tree Collapse file tree 1 file changed +25
-9
lines changed
Expand file tree Collapse file tree 1 file changed +25
-9
lines changed Original file line number Diff line number Diff line change 11name : build
2- on : [push, pull_request]
3- jobs :
2+ on :
3+ push :
4+ branches :
5+ - master
6+ - main
7+ pull_request :
48
5- test-build :
9+ jobs :
10+ test :
611 name : Test & Build
712 runs-on : ubuntu-latest
813 steps :
914
10- - name : Set up Go 1.15
11- uses : actions/setup-go@v1
15+ - name : Set up Go 1.16
16+ uses : actions/setup-go@v2
1217 with :
13- go-version : 1.15.3
14- id : go
18+ go-version : ^1.16
1519
1620 - name : Check out code into the Go module directory
1721 uses : actions/checkout@v2
22+
23+ - name : Run go mod tidy
24+ run : |
25+ set -e
26+ go mod tidy
27+ output=$(git status -s)
28+ if [ -z "${output}" ]; then
29+ exit 0
30+ fi
31+ echo 'We wish to maintain a tidy state for go mod. Please run `go mod tidy` on your branch, commit and push again.'
32+ echo 'Running `go mod tidy` on this CI test yields with the following changes:'
33+ echo "$output"
34+ exit 1
1835
1936 - name : Test
20- run : |
21- go test -race ./...
37+ run : go test -race ./...
2238
2339 - name : Build
2440 run : go build ./...
You can’t perform that action at this time.
0 commit comments