-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (59 loc) · 1.61 KB
/
test.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
name: test
on:
push:
tags:
- v*
branches:
- main
pull_request:
permissions:
contents: read
pull-requests: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: WillAbides/[email protected]
with:
go-version: stable
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: go mod download -x
- run: go test -v ./... -race -bench=. -benchmem -cover -coverprofile cover.out 2>&1 | tee test.out
- run: go tool cover -func cover.out
lint:
runs-on: ubuntu-latest
steps:
- uses: WillAbides/[email protected]
with:
go-version: stable
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: go mod download -x
- run: go mod tidy && git diff --exit-code go.mod go.sum
- run: go vet ./...
- uses: dominikh/[email protected]
with:
install-go: false
- uses: golangci/golangci-lint-action@v6
with:
version: latest
args: >
--enable
asasalint,bidichk,dupword,errchkjson,godot,gofumpt,gosec,gosimple,ineffassign,misspell,loggercheck,revive,unused
--disable
errcheck