changes #10
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: Go CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22' | |
- name: Install dependencies | |
run: go mod download | |
- name: Run go fmt | |
run: go fmt ./... | |
- name: Run go vet | |
run: go vet ./... | |
- name: Run golint | |
run: | | |
go install golang.org/x/lint/golint@latest | |
OUTPUT=$(golint ./...); \ | |
echo "$OUTPUT"; \ | |
if [ -n "$OUTPUT" ]; then \ | |
echo "Linting issues found"; \ | |
exit 1; \ | |
fi | |
- name: Run tests | |
run: go test -v ./... | |
- name: Build binaries | |
run: make build |