Skip to content

Commit

Permalink
Revert "gha: cleanup lint-golang"
Browse files Browse the repository at this point in the history
This reverts commit c13ead2.
  • Loading branch information
andrewhsu committed Aug 19, 2024
1 parent a0f4e04 commit e3c9e63
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/lint-golang.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
---
name: Lint golang
on: [push, pull_request]

on: [ push, pull_request ]

jobs:
go:
name: Lint go files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Setup go
uses: actions/setup-go@v3
with:
go-version: stable
- uses: golangci/golangci-lint-action@v3

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
args: --timeout 5m

- name: Install gofumpt
env:
GOFUMPT_VER: 0.5.0
run: |
mkdir -v -p "$HOME/.local/bin"
wget -O "$HOME/.local/bin/gofumpt" "https://github.com/mvdan/gofumpt/releases/download/v${GOFUMPT_VER}/gofumpt_v${GOFUMPT_VER}_linux_amd64"
chmod 0700 "$HOME/.local/bin/gofumpt"
- name: Run gofumpt
run: |
find . -type f -name '*.go' ! -name '*.pb.go' | xargs -n1 "$HOME/.local/bin/gofumpt" -w -lang=1.21
git diff --exit-code
- name: Tidy go mod
- name: go mod tidy
run: |
go mod tidy
git diff --exit-code -- go.mod go.sum
git diff --exit-code -- go.mod go.sum

0 comments on commit e3c9e63

Please sign in to comment.