Skip to content

Commit

Permalink
Add github action for lint validation
Browse files Browse the repository at this point in the history
  • Loading branch information
chvck committed Oct 15, 2024
1 parent f68bd3e commit a409e52
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run Linter
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- run: |
go install golang.org/x/tools/cmd/goimports@latest
- name: goimports
run: |
goimports -w .
find . -name go.mod -execdir go mod tidy \;
if [ -n "$(git status --porcelain)" ]; then
echo 'To fix this check, run "goimports -w . && find . -name go.mod -execdir go mod tidy \;"'
git status # Show the files that failed to pass the check.
exit 1
fi
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.55
args: --timeout=3m
skip-pkg-cache: true
skip-build-cache: true

0 comments on commit a409e52

Please sign in to comment.