-
Notifications
You must be signed in to change notification settings - Fork 70
57 lines (49 loc) · 1.47 KB
/
ci.yaml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Go
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
go:
- "1.18"
- "1.19"
steps:
- uses: actions/checkout@v2
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Install dependencies
run: |
# The latest crlfmt requires go1.19.
go install github.com/cockroachdb/crlfmt@024b567ce87bf2b89f2cffabb7a8f4ea0cfa8b98
go install github.com/kisielk/errcheck@latest
go install github.com/mdempsky/unconvert@latest
go install honnef.co/go/tools/cmd/[email protected]
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
- name: Race
run: go test -p 1 -v ./...
- name: gofmt
run: gofmt -s -d -l .
- name: vet
run: |
! go vet -vettool=$(which shadow) ./... 2>&1 | \
grep -vF 'declaration of "err" shadows declaration at' | \
grep -vF "# github.com/cockroachdb/cockroach-go/v2/testserver"
- name: License checks
run: |
! git grep -lE '^// Author' -- '*.go'
! git grep -LE '^// Copyright' -- '*.go'
- name: errchk
run: errcheck -ignore "Close|Init|AutoMigrate" ./...
- name: staticcheck
run: staticcheck ./...