name: Test on: pull_request: push: branches: - main jobs: test: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v6 - name: Set up Go uses: actions/setup-go@v6 with: go-version-file: go.mod cache: true - name: Verify formatting run: | unformatted="$(gofmt -l .)" if [ -n "$unformatted" ]; then echo "Files need gofmt:" echo "$unformatted" exit 1 fi - name: Run tests run: go test ./...