ci: add golangci-lint for linting (#3269)

This commit is contained in:
sukun
2025-04-14 15:21:03 +05:30
committed by GitHub
parent 58d21ca241
commit 4b7997256e
4 changed files with 63 additions and 3 deletions
+39
View File
@@ -19,3 +19,42 @@ jobs:
with:
go-version: "1.24.x"
go-generate-ignore-protoc-version-comments: true
golangci-lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: [ "1.23.x", "1.24.x" ]
env:
GOLANGCI_LINT_VERSION: v2.0.2
name: golangci-lint (Go ${{ matrix.go }})
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: golangci-lint (Linux)
uses: golangci/golangci-lint-action@v7
with:
args: --timeout=5m
version: ${{ env.GOLANGCI_LINT_VERSION }}
only-new-issues: true
- name: golangci-lint (Windows)
if: success() || failure() # run this step even if the previous one failed
uses: golangci/golangci-lint-action@v7
env:
GOOS: "windows"
with:
args: --timeout=5m
version: ${{ env.GOLANGCI_LINT_VERSION }}
only-new-issues: true
- name: golangci-lint (OSX)
if: success() || failure() # run this step even if the previous one failed
uses: golangci/golangci-lint-action@v7
env:
GOOS: "darwin"
with:
args: --timeout=5m
version: ${{ env.GOLANGCI_LINT_VERSION }}
only-new-issues: true