Fix linter errors #99
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
on: | |
push: | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' | |
- uses: actions/checkout@v3 | |
- name: Generate | |
run: | | |
go generate ./... | |
git diff --exit-code | |
- name: Build | |
run: go build ./... | |
- name: Test | |
run: go test -v ./... | |
- name: Install Lint Tools | |
run: | | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
go install honnef.co/go/tools/cmd/staticcheck@latest | |
go install golang.org/x/lint/golint@latest | |
go install mvdan.cc/gofumpt@latest | |
- name: Lint | |
run: | | |
staticcheck ./... | |
golint ./... | |
go vet ./... | |
test -z "$( gofumpt -extra -l ./ )" | |
release: | |
runs-on: ubuntu-latest | |
needs: test | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' | |
- uses: actions/checkout@v3 | |
- uses: goreleaser/goreleaser-action@v4 | |
name: Run GoReleaser | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |