-
Notifications
You must be signed in to change notification settings - Fork 589
44 lines (37 loc) · 1.02 KB
/
test-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Go test and lint
on:
pull_request:
branches: 'master'
jobs:
go-test-lint:
strategy:
matrix:
go: [1.19, 1.18]
golangcli: [v1.53.3]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
cache: true
- name: Validate go mod / generate
run: |
go mod tidy
go install golang.org/x/tools/cmd/stringer@latest
go generate ./...
git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]]
- name: Go Lint
uses: golangci/golangci-lint-action@v3
with:
version: ${{ matrix.golangcli }}
args: "--out-${NO_FUTURE}format colored-line-number"
skip-pkg-cache: true
skip-build-cache: true
- name: Go Build
run: go build ./...
- name: Go Test
run: go test -race -v ./...