Files
HackBrowserData/.github/workflows/lint.yml
T
Roger 6d6191b4c6 ci: pin golangci-lint 2.14, add -race, fix golden updates (#674)
Local v2.14 and CI v2.10 disagreed on gofumpt; extra.group-params keeps v2.10's rules exactly.
go test ./... -update failed in the 12 packages that never import golden, so it is HBD_UPDATE_GOLDEN=1 now.
2026-11-01 23:39:04 +08:00

44 lines
1.1 KiB
YAML

name: Lint
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
lint:
name: Lint (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: '1.20.x'
- name: Check Go version constraint
if: matrix.os == 'ubuntu-latest'
run: |
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
if [ "$GO_VERSION" != "1.20" ]; then
echo "::error::go.mod directive must remain 'go 1.20' (Windows 7 support requirement)"
echo "::error::Current value: go $GO_VERSION"
exit 1
fi
if grep -q '^toolchain' go.mod; then
echo "::error::go.mod must not carry a toolchain line (keeps the module on Go 1.20)"
exit 1
fi
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.14