...
1name: Go
2
3on:
4 push:
5 branches: [ master ]
6 pull_request:
7 branches: [ master ]
8jobs:
9 build:
10 strategy:
11 matrix:
12 go-versions: [1.16.x, 1.17.x, 1.18.x, 1.19.x]
13 runs-on: ubuntu-latest
14 steps:
15 - uses: actions/checkout@v2
16 - name: Set up Go
17 uses: actions/setup-go@v2
18 with:
19 go-version: ${{ matrix.go-versions }}
20 - name: Install
21 run: GO111MODULE=off go get golang.org/x/lint/golint
22 - name: Run gofmt
23 run: diff -u <(echo -n) <(gofmt -d *.go)
24 - name: Run golint
25 run: diff -u <(echo -n) <(golint $(go list -e ./... | grep -v /goyaml) | grep -v YAMLToJSON)
26 - name: Run go vet
27 run: GO111MODULE=on go vet .
28 - name: Run go test
29 run: GO111MODULE=on go test -v -race ./...
30 - name: Check diff
31 run: git diff --exit-code
View as plain text