Skip to content

Commit

Permalink
chore: check go.mod and run gofmt in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Jan 29, 2025
1 parent 4bd6fba commit cf2c101
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ on:
types: [opened, edited, synchronize, reopened]

jobs:
go-mod:
name: Check go.mod
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Check go mod
run: |
go mod tidy
git diff --exit-code go.mod
git diff --exit-code go.sum
lint:
name: Lint
Expand All @@ -14,6 +27,15 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: stable

- name: Run gofmt
run: |
find . -type f -name '*.go' -not -path './testdata/*' -exec gofmt -w {} +
git diff --exit-code
- name: Run Revive Action
uses: morphy2k/revive-action@v2
with:
Expand Down

0 comments on commit cf2c101

Please sign in to comment.