-
Notifications
You must be signed in to change notification settings - Fork 1.8k
45 lines (39 loc) · 1.05 KB
/
lint.yml
File metadata and controls
45 lines (39 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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