fix: github workflows #21
This file contains hidden or 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 Quality Checks | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| quality-checks: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v5 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v8 | |
| - name: Run tests | |
| run: | | |
| go test -v ./... | |
| - name: Install govulncheck | |
| run: | | |
| go install golang.org/x/vuln/cmd/govulncheck@latest | |
| - name: Verify go.mod is tidy | |
| run: | | |
| go mod tidy | |
| git diff --exit-code go.mod|| (echo "Please run 'go mod tidy' and commit the changes" && exit 1) | |
| - name: Check formatting | |
| run: | | |
| go fmt ./... | |
| git diff --exit-code || (echo "Please run 'go fmt ./...' and commit the changes" && exit 1) | |
| - name: Run go vet | |
| run: | | |
| go vet ./... | |
| - name: Run govulncheck | |
| run: | | |
| govulncheck ./... |