Update actions/setup-go action to v7 #60
Workflow file for this run
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: Presubmit Checks | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main ] | |
| # Publish semver tags as releases. | |
| tags: [ 'v*.*.*' ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| presubmit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Set up Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Verify dependencies | |
| run: go mod verify | |
| - name: Run go vet | |
| run: go vet ./... | |
| - name: Run go fmt check | |
| run: | | |
| if [ -n "$(gofmt -s -l .)" ]; then | |
| echo "Go code is not formatted:" | |
| gofmt -s -d . | |
| exit 1 | |
| fi | |
| - name: Build | |
| run: go build -v ./... | |
| - name: Run tests (if any exist) | |
| run: | | |
| if go list ./... | grep -q .; then | |
| go env -w GOTOOLCHAIN=go1.25.4+auto # hack for covdata | |
| go test -v -race -coverprofile=coverage.out ./... | |
| else | |
| echo "No tests found, skipping" | |
| fi |