Skip to content

Commit 3763175

Browse files
committed
add ci
1 parent 4b931bd commit 3763175

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Reviewdog
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
jobs:
8+
golangci-lint:
9+
name: golangci-lint
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out code into the Go module directory
13+
uses: actions/checkout@v3
14+
- name: golangci-lint
15+
uses: reviewdog/action-golangci-lint@v2
16+
with:
17+
github_token: ${{ secrets.GITHUB_TOKEN }}
18+
level: warning
19+
golangci_lint_flags: "--config=.golangci.yaml"
20+
filter_mode: nofilter
21+
reporter: github-pr-review

.github/workflows/test.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on: [push, pull_request]
2+
name: Test
3+
jobs:
4+
test:
5+
strategy:
6+
matrix:
7+
go-version: [1.19.x]
8+
os: [ubuntu-latest]
9+
runs-on: ${{ matrix.os }}
10+
steps:
11+
- uses: actions/setup-go@v3
12+
with:
13+
go-version: ${{ matrix.go-version }}
14+
- uses: actions/checkout@v3
15+
- run: go test ./...

.golangci.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
linters:
2+
enable:
3+
- cyclop
4+
- dupl
5+
- durationcheck
6+
- errorlint
7+
- exhaustive
8+
- exportloopref
9+
- forcetypeassert
10+
- gocognit
11+
- goconst
12+
- gocritic
13+
- gocyclo
14+
- gofmt
15+
- gomnd
16+
- gosec
17+
- ifshort
18+
- lll
19+
- makezero
20+
- nakedret
21+
- nestif
22+
- nilerr
23+
- noctx
24+
- prealloc
25+
- unconvert
26+
- unparam
27+
- wastedassign
28+
- wrapcheck

0 commit comments

Comments
 (0)