-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (52 loc) · 1.31 KB
/
go.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Go
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
build:
strategy:
matrix:
go: ['stable', 'oldstable']
os: ['ubuntu-latest']
runs-on: ${{ matrix.os }}
name: Go ${{ matrix.go }} in ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
name: Install Go
with:
go-version: ${{ matrix.go }}
check-latest: true
cache: true
- name: Go Environment
run: |
go version
go env
- name: Get dependencies
run: go get -v -t -d ./...
- name: Run Fmt
run: go fmt ./...
- name: Run Vet
run: |
go vet -stdmethods=false $(go list ./...)
go mod tidy
if ! test -z "$(git status --porcelain)"; then
echo "Please run 'go mod tidy'"
exit 1
fi
- name: Run Lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
only-new-issues: true
skip-pkg-cache: true
- name: Run Staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck ./...
- name: Run Test
run: go test -race -coverpkg=./... -coverprofile=coverage.txt ./...