Repository navigation
chore: 🐝 Update SDK - Generate 3.1.0 #219
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: "go.mod" | |
| cache: true | |
| - name: gofmt | |
| run: | | |
| unformatted=$(gofmt -l .) | |
| if [ -n "$unformatted" ]; then | |
| echo "These files are not gofmt-formatted:"; echo "$unformatted"; exit 1 | |
| fi | |
| - name: Build | |
| run: go build ./... | |
| # `go vet ./...` is intentionally omitted: it fails on generated SDK structs | |
| # (unexported fields with json tags), which we don't hand-edit. Speakeasy runs | |
| # staticcheck (with exclusions) during `speakeasy run`, which is the real lint gate. | |
| # The CLI command surface (every command + its flags) is generated from | |
| # the OpenAPI spec, so a spec/overlay change can silently add, drop, or | |
| # rename one. Regenerate the golden snapshot and fail if the committed copy | |
| # is stale — a bare `speakeasy run` doesn't refresh it, so this makes the | |
| # regen PR carry the surface diff instead of letting it drift. | |
| - name: Check command surface is up to date | |
| run: | | |
| go generate ./internal/cli/... | |
| # --porcelain catches both a stale tracked golden and a new, | |
| # never-committed one (which `git diff` alone would miss). | |
| if [ -n "$(git status --porcelain -- internal/cli/testdata)" ]; then | |
| git --no-pager diff -- internal/cli/testdata | |
| echo "::error::CLI command surface changed. Run 'go generate ./internal/cli/...' and commit internal/cli/testdata/command-surface.txt." | |
| exit 1 | |
| fi | |
| # Runs the hand-written unit + end-to-end tests (custom config/migration, | |
| # and the in-process CLI-vs-mock-server e2e suite in internal/cli). All are | |
| # offline. NOTE: if Speakeasy contract tests are ever enabled (gen.yaml → | |
| # tests.generateTests: true), those need a mock server via `speakeasy test` | |
| # and must run in a separate job, not here. | |
| - name: Test | |
| run: go test ./... |