Skip to content

Setup golangci-lint configuration with dedicated lint workflow #16

Setup golangci-lint configuration with dedicated lint workflow

Setup golangci-lint configuration with dedicated lint workflow #16

Workflow file for this run

name: Lint
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
golangci-lint:
strategy:
fail-fast: false
matrix:
include:
# macOS combinations
- {os: macos-latest, CGO_ENABLED: "0", GOOS: darwin, GOARCH: amd64}
- {os: macos-latest, CGO_ENABLED: "1", GOOS: darwin, GOARCH: amd64}
- {os: macos-latest, CGO_ENABLED: "0", GOOS: darwin, GOARCH: arm64}
- {os: macos-latest, CGO_ENABLED: "1", GOOS: darwin, GOARCH: arm64}
# Linux combinations
- {os: ubuntu-latest, CGO_ENABLED: "0", GOOS: linux, GOARCH: amd64}
- {os: ubuntu-latest, CGO_ENABLED: "1", GOOS: linux, GOARCH: amd64}
- {os: ubuntu-latest, CGO_ENABLED: "0", GOOS: linux, GOARCH: arm64}
# FreeBSD/NetBSD combinations sans CGO_ENABLED=1
- {os: ubuntu-latest, CGO_ENABLED: "0", GOOS: freebsd, GOARCH: amd64}
- {os: ubuntu-latest, CGO_ENABLED: "0", GOOS: freebsd, GOARCH: arm64}
- {os: ubuntu-latest, CGO_ENABLED: "0", GOOS: netbsd, GOARCH: amd64}
- {os: ubuntu-latest, CGO_ENABLED: "0", GOOS: netbsd, GOARCH: arm64}
# Windows combinations
- {os: windows-latest, CGO_ENABLED: "0", GOOS: windows, GOARCH: amd64}
- {os: windows-latest, CGO_ENABLED: "1", GOOS: windows, GOARCH: amd64}
- {os: windows-latest, CGO_ENABLED: "0", GOOS: windows, GOARCH: arm64}
- {os: windows-latest, CGO_ENABLED: "0", GOOS: windows, GOARCH: 386}
permissions:
contents: read
pull-requests: read
name: lint (${{ matrix.GOOS }}/${{ matrix.GOARCH }}/cgo=${{ matrix.CGO_ENABLED }})
runs-on: ${{ matrix.os }}
env:
CGO_ENABLED: "${{ matrix.CGO_ENABLED }}"
GOARCH: ${{ matrix.GOARCH }}
GOOS: ${{ matrix.GOOS }}
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod
- name: Run golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
args: --verbose