name: Pull Request on: pull_request: branches: - main jobs: test-and-lint: name: Test, Format & Lint runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v6 - name: Set up Go uses: actions/setup-go@v6 with: go-version: '1.25' cache: true - name: Check formatting run: | # Fails if any files are not formatted correctly if [ -n "$(gofmt -l .)" ]; then echo "Go code is not formatted:" gofmt -d . exit 1 fi - name: Run go vet run: go vet ./... - name: Run tests run: go test -v ./... - name: Run linter uses: golangci/golangci-lint-action@v9 with: version: latest