-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.11 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
name: Go build, test and lint
on:
push:
tags:
- v*
branches:
- main
pull_request:
permissions:
contents: read
jobs:
go:
strategy:
matrix:
go: [1.19]
golangci: [v1.55.1]
os: [ubuntu-latest, macos-latest, windows-latest]
name: lint
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: actions/setup-go@v4
with:
go-version: '${{ matrix.go }}'
- name: Validate go generate / mod
if: runner.os != 'Windows'
run: |
go install golang.org/x/tools/cmd/stringer@latest
go generate ./...
go mod tidy
git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]]
- name: Go Lint
uses: golangci/golangci-lint-action@v3
with:
version: ${{ matrix.golangci }}
args: --out-format=colored-line-number
skip-build-cache: true
skip-pkg-cache: true
- name: Go Build
run: go build ./...
- name: Go Test
run: go test -race -v ./...