54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
name: Go Lint
|
|
|
|
# The repository carries a large backlog of pre-existing golangci-lint findings,
|
|
# so pull requests are only judged on the code they introduce (`only-new-issues`).
|
|
# That filter needs a pull request diff, which is why this workflow has no other
|
|
# trigger; the companion go-lint-cache.yml keeps the caches this job restores
|
|
# from warm on main.
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "**/*.go"
|
|
- "**/go.mod"
|
|
- "**/go.sum"
|
|
- ".golangci.yml"
|
|
- ".github/workflows/go-lint.yml"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
GO_VERSION: "1.26"
|
|
GOLANGCI_LINT_VERSION: "v2.12.2"
|
|
GOPROXY: https://proxy.golang.org,direct
|
|
|
|
jobs:
|
|
golangci:
|
|
name: golangci-lint (${{ matrix.module }})
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
module: [".", "cli", "client"]
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
cache-dependency-path: ${{ matrix.module }}/go.sum
|
|
|
|
- uses: golangci/golangci-lint-action@v9
|
|
with:
|
|
version: ${{ env.GOLANGCI_LINT_VERSION }}
|
|
working-directory: ${{ matrix.module }}
|
|
only-new-issues: true
|