name: test on: push: pull_request: jobs: test: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: go.mod - name: go vet run: go vet ./... - name: gofmt check run: | unformatted=$(gofmt -l .) if [ -n "$unformatted" ]; then echo "The following files are not gofmt-formatted:" echo "$unformatted" exit 1 fi - name: go test run: go test ./... - name: go build run: go build ./...