-
-
Notifications
You must be signed in to change notification settings - Fork 41
73 lines (66 loc) · 1.76 KB
/
test_and_lint.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
66
67
68
69
70
71
72
73
name: Test & Lint
on:
push:
paths:
- '**.go'
- 'go.mod'
- '.github/workflows/test_and_lint.yml'
pull_request:
paths:
- '**.go'
- 'go.mod'
- '.github/workflows/test_and_lint.yml'
permissions:
contents: read
checks: write
pull-requests: write
jobs:
test-and-lint:
name: Test & Lint
runs-on: ubuntu-latest
steps:
- name: Code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- run: go get
- run: go generate ./...
- run: go test -v -race ./...
- run: go vet ./...
- name: GolangCI-Lint with reviewdog
uses: reviewdog/action-golangci-lint@v2
if: github.event_name == 'pull_request'
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tool_name: 'golangci-lint'
level: 'error'
reporter: 'github-pr-check'
filter_mode: 'file'
golangci_lint_version: 'v1.61.0'
go_version: '1.22'
cache: false
- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v6
if: github.event_name != 'pull_request'
with:
version: 'v1.61.0'
args: '--timeout 9999s'
skip-cache: true
action-lint:
name: Action Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-actionlint@v1
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
fail_on_error: false
level: 'error'
reporter: 'github-pr-review'