Skip to content

Commit a34327e

Browse files
authored
chore: check go.mod and run gofmt in CI (#1215)
1 parent 4bd6fba commit a34327e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/lint.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,32 @@ on:
55
types: [opened, edited, synchronize, reopened]
66

77
jobs:
8+
go-mod:
9+
name: Check go.mod
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-go@v5
14+
with:
15+
go-version: stable
16+
- name: Check go.mod
17+
run: |
18+
go mod tidy
19+
git diff --exit-code go.mod
20+
git diff --exit-code go.sum
21+
22+
gofmt:
23+
name: Check unformatted Go code
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-go@v5
28+
with:
29+
go-version: stable
30+
- name: Run gofmt
31+
run: |
32+
find . -type f -name '*.go' -not -path './testdata/*' -exec gofmt -w {} +
33+
git diff --exit-code
834
935
lint:
1036
name: Lint

0 commit comments

Comments
 (0)