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@v6 - uses: actions/setup-go@v6 with: go-version-file: go.mod - 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 - name: Check spelling if: matrix.os == 'ubuntu-latest' uses: crate-ci/typos@master with: config: ./.typos.toml - name: golangci-lint uses: golangci/golangci-lint-action@v8 with: version: v2.10