Skip to content

Commit d903378

Browse files
committed
Add lint workflow
1 parent b4c97bd commit d903378

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
lint:
14+
uses: ./.github/workflows/reusable-lint.yml
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint Code
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v6
11+
- name: Set up Go
12+
uses: actions/setup-go@v6
13+
with:
14+
go-version-file: go.mod
15+
cache-dependency-path: go.sum
16+
- name: Check go.mod and go.sum
17+
run: go mod tidy -diff
18+
- name: Run golangci-lint
19+
uses: golangci/golangci-lint-action@v9
20+
with:
21+
version: v2.11.3 # Should match .pre-commit-config.yaml
22+
args: --timeout=20m

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.*
22
!.gitignore
3+
!.github/
34
!.justfile
45
!.golangci.yml
56
!.pre-commit-config.yaml

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
require_serial: true
1010
pass_filenames: false
1111
- repo: https://github.com/golangci/golangci-lint
12-
rev: v2.11.3
12+
rev: v2.11.3 # Should match .github/workflows/reusable-lint.yml
1313
hooks:
1414
- id: golangci-lint-full
1515
language_version: 1.26.0

0 commit comments

Comments
 (0)