Skip to content

Commit

Permalink
ci: add linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Szzrain committed Apr 16, 2024
1 parent d011690 commit 484e36b
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/test_and_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
on:
push:
paths:
- '**.go'
- 'go.mod'
pull_request:
paths:
- '**.go'
- 'go.mod'

name: Test & Lint

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.19'
cache: false
- run: go get
- run: go generate ./...
- run: go test -v -race ./...

lint:
runs-on: ubuntu-latest
steps:
- name: Code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
cache: false
go-version: '1.19'
- run: go get
- run: go generate ./...
- name: Go vet
run: go vet ./...

- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v3
if: github.event.name == 'pull_request'
with:
version: 'v1.55.2'
args: '--timeout 9999s'
only-new-issues: true
skip-pkg-cache: true
skip-build-cache: true

- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v3
if: github.event.name != 'pull_request'
with:
version: 'v1.55.2'
args: '--timeout 9999s'
skip-pkg-cache: true
skip-build-cache: true

0 comments on commit 484e36b

Please sign in to comment.