-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (31 loc) · 1013 Bytes
/
lint.yaml
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
name: Lint
on:
workflow_call:
jobs:
lint:
name: Run Linter
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
- name: Set up Go
uses: actions/setup-go@c4c114188661c0fa735e5b938764519fc6e8efa9
with:
go-version: "1.24.1"
- name: Install dependencies
run: go mod download
- name: Install templ
run: go install github.com/a-h/templ/cmd/templ@latest
- name: Generate templates
run: templ generate
- name: Run golangci-lint
uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea
with:
version: v1.64.5
args: --timeout=5m
- name: Format Go code
run: |
go fmt ./...
- name: Check for uncommitted changes after formatting
run: |
git diff --exit-code || (echo "Detected unformatted files. Run 'go fmt' to format your code."; exit 1)