From 982a72bb443070016d49e16827888387f838e3df Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 29 Jan 2025 18:45:01 +0200 Subject: [PATCH] chore: check go.mod and run gofmt in CI --- .github/workflows/lint.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 3f22a974f..7dbf50571 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -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 @@ -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: Check unformatted Go code + 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: