-
Notifications
You must be signed in to change notification settings - Fork 5
48 lines (46 loc) · 1.25 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
name: Go
on: [push]
jobs:
test:
strategy:
matrix:
go-version: [1.21.x]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Environment information
run: |
uname -a
go version
go env
- name: Vet
if: matrix.platform == 'ubuntu-latest'
run: go vet -v ./...
- name: Lint
if: matrix.platform == 'ubuntu-latest'
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go install golang.org/x/lint/golint@latest
golint -set_exit_status ./...
- name: staticcheck.io
if: matrix.platform == 'ubuntu-latest'
uses: dominikh/[email protected]
with:
install-go: false
- name: gofumpt formatting
if: matrix.platform == 'ubuntu-latest'
run: |
export PATH=$PATH:$(go env GOPATH)/bin
go install mvdan.cc/gofumpt@latest
gofumpt -d .
[ -z "$(gofumpt -l .)" ]
- name: Test
run: go test -vet=off -count=1 ./...
- name: Test with -race
run: go test -vet=off -race -count=1 ./...