-
Notifications
You must be signed in to change notification settings - Fork 143
105 lines (98 loc) · 3.26 KB
/
reviewdog.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: reviewdog
on: [pull_request]
jobs:
golangci-lint:
name: runner / suggester / golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
only-new-issues: true
args: --timeout 5m
gofmt:
name: runner / suggester / gofmt
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- run: gofmt -w -s $(find . -not -path "*/vendor/*" -name "*.go")
- uses: reviewdog/action-suggester@v1
with:
tool_name: gofmt
goimports-reviser:
name: runner / suggester / goimports-reviser
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-go@v5
with:
go-version: '^1.22'
- run: go install -v github.com/incu6us/goimports-reviser/v3@latest
- run: $(go env GOPATH)/bin/goimports-reviser -imports-order "std,general,company,project" -company-prefixes "github.com/percona" ./...
- uses: reviewdog/action-suggester@v1
with:
tool_name: goimports-reviser
shfmt:
name: runner / suggester / shfmt
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/setup-go@v5
with:
go-version: '^1.22'
- run: go install mvdan.cc/sh/v3/cmd/shfmt@latest
- run: $(go env GOPATH)/bin/shfmt -f . | grep -v 'vendor' | xargs $(go env GOPATH)/bin/shfmt -bn -ci -s -w
- name: suggester / shfmt
uses: reviewdog/action-suggester@v1
with:
tool_name: shfmt
shellcheck:
if: github.event_name == 'pull_request'
name: runner / shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: reviewdog/action-shellcheck@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-check
exclude: "./vendor/*"
misspell:
name: runner / misspell
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: reviewdog/action-misspell@v1
with:
github_token: ${{ secrets.github_token }}
locale: "US"
reporter: github-pr-check
exclude: "./vendor/*"
alex:
name: runner / alex
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: reviewdog/action-alex@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
level: info
exclude: "./vendor/*"
manifests:
name: runner / manifests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: check on release branch
if: ${{ contains(github.head_ref, 'release-') || contains(github.base_ref, 'release-') }}
run: |
make generate manifests VERSION="$(grep "Version" version/version.go|grep -oE "[0-9]+\.[0-9]+\.[0-9]+")" IMAGE_TAG_BASE="percona/percona-server-mongodb-operator"
git diff --exit-code
- name: check on non release branches
if: ${{ ! (contains(github.head_ref, 'release-') || contains(github.base_ref, 'release-')) }}
run: |
make generate manifests VERSION=main
git diff --exit-code