Repository navigation
AI-3716: use the database clock for more leases #1004
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 (Go) | |
| # The router, the Go SDK, the terminal UI and the load benchmark, tied together by go.work. | |
| # Feature branches run through pull_request; a push of the same commit would be a second, | |
| # uncancellable copy of every job. A push to main runs it on the same paths as a pull request. | |
| # A pull request that changes none of them never starts this workflow, so its check must not | |
| # be made required: it would wait forever on such a pull request. | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - 'acceleration/**' | |
| - 'sdks/go/**' | |
| - 'tui/**' | |
| - 'performance_benchmark/**' | |
| # The example modules go.work uses: their requirements take part in the workspace's | |
| # version selection, so they change what the router, SDK and TUI build against. | |
| - 'examples/routers/chorus_asr_example/go.mod' | |
| - 'examples/routers/chorus_asr_example/go.sum' | |
| - 'examples/routers/stt_realtime_example/go.mod' | |
| - 'examples/routers/stt_realtime_example/go.sum' | |
| - 'examples/voice_agents/swift_assistant/backend/go.mod' | |
| - 'examples/voice_agents/swift_assistant/backend/go.sum' | |
| - 'examples/voice_agents/swift_assistant/configure/go.mod' | |
| - 'examples/voice_agents/swift_assistant/configure/go.sum' | |
| - 'examples/voice_agents/swift_demo/backend/go.mod' | |
| - 'examples/voice_agents/swift_demo/backend/go.sum' | |
| - 'examples/voice_agents/swift_demo/configure/go.mod' | |
| - 'examples/voice_agents/swift_demo/configure/go.sum' | |
| - 'go.work' | |
| - 'go.work.sum' | |
| - '.github/workflows/ci-go.yml' | |
| - '!**/*.md' | |
| pull_request: | |
| branches: [ "**" ] | |
| # A draft runs nothing: CI starts when the pull request is marked ready (ready_for_review) | |
| # and runs on every push after that. The default types leave out ready_for_review. | |
| types: [ opened, synchronize, reopened, ready_for_review ] | |
| paths: | |
| - 'acceleration/**' | |
| - 'sdks/go/**' | |
| - 'tui/**' | |
| - 'performance_benchmark/**' | |
| # The example modules go.work uses: their requirements take part in the workspace's | |
| # version selection, so they change what the router, SDK and TUI build against. | |
| - 'examples/routers/chorus_asr_example/go.mod' | |
| - 'examples/routers/chorus_asr_example/go.sum' | |
| - 'examples/routers/stt_realtime_example/go.mod' | |
| - 'examples/routers/stt_realtime_example/go.sum' | |
| - 'examples/voice_agents/swift_assistant/backend/go.mod' | |
| - 'examples/voice_agents/swift_assistant/backend/go.sum' | |
| - 'examples/voice_agents/swift_assistant/configure/go.mod' | |
| - 'examples/voice_agents/swift_assistant/configure/go.sum' | |
| - 'examples/voice_agents/swift_demo/backend/go.mod' | |
| - 'examples/voice_agents/swift_demo/backend/go.sum' | |
| - 'examples/voice_agents/swift_demo/configure/go.mod' | |
| - 'examples/voice_agents/swift_demo/configure/go.sum' | |
| - 'go.work' | |
| - 'go.work.sum' | |
| - '.github/workflows/ci-go.yml' | |
| - '!**/*.md' | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| # Cancel in-flight runs for the same branch/PR when new commits arrive | |
| concurrency: | |
| group: ci-go-${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| go: | |
| if: github.event.pull_request.draft != true | |
| runs-on: { group: github-public-amd64 } | |
| # Every backend test that needs Redis skips without ROUTER_REDIS_ADDR: the service gives | |
| # them one, on a host port the runner picks so a port already held on the runner cannot | |
| # fail the job. The health check holds the steps until it answers PING. | |
| services: | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 5s | |
| --health-timeout 3s | |
| --health-retries 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: acceleration/go.mod | |
| cache-dependency-path: | | |
| acceleration/go.sum | |
| sdks/go/go.sum | |
| tui/go.sum | |
| performance_benchmark/go.sum | |
| examples/routers/chorus_asr_example/go.sum | |
| examples/routers/stt_realtime_example/go.sum | |
| examples/voice_agents/swift_assistant/backend/go.sum | |
| examples/voice_agents/swift_assistant/configure/go.sum | |
| examples/voice_agents/swift_demo/backend/go.sum | |
| examples/voice_agents/swift_demo/configure/go.sum | |
| # The spec is rendered from the server's Go operations and the clients are generated | |
| # from the spec, so any of them left behind has already drifted from the others. | |
| - name: Check the generated code is in step with the spec | |
| run: | | |
| (cd acceleration && go run ./cmd/openapi) | |
| (cd sdks/go && go generate ./...) | |
| git diff --exit-code -- acceleration/api/openapi.yaml sdks/go/acceleration/generated.go | |
| # internal/video samples clips with ffmpeg and ffprobe, and its tests skip without them. | |
| - name: Install ffmpeg | |
| run: sudo apt-get update -qq && sudo apt-get install -y -qq ffmpeg | |
| # The backend is built with Go's SIMD experiment, as acceleration/Dockerfile builds it. | |
| - name: Vet the backend | |
| run: go vet ./... | |
| working-directory: acceleration | |
| env: | |
| GOEXPERIMENT: simd | |
| # -race also checks unsafe pointer arithmetic (checkptr). The SIMD code of gopus fails that | |
| # check, so it is off for gopus only. | |
| - name: Test the backend | |
| run: go test -race -gcflags='github.com/thesyncim/gopus/...=-d=checkptr=0' ./... | |
| working-directory: acceleration | |
| env: | |
| GOEXPERIMENT: simd | |
| ROUTER_REDIS_ADDR: localhost:${{ job.services.redis.ports['6379'] }} | |
| # Without the experiment the Opus codec runs its scalar code, which must still build | |
| # and pass. | |
| - name: Test the audio without SIMD | |
| run: go build ./... && go test ./internal/audio/... ./internal/audiofloor/... ./internal/agent/streamedge/... | |
| working-directory: acceleration | |
| - name: Vet phonecheck | |
| run: go vet ./... | |
| working-directory: acceleration/cmd/phonecheck | |
| - name: Test phonecheck | |
| run: go test -race ./... | |
| working-directory: acceleration/cmd/phonecheck | |
| - name: Compile STS integration tests | |
| run: go test -tags integration -run '^$' -exec=true ./internal/sts/... | |
| working-directory: acceleration | |
| env: | |
| GOEXPERIMENT: simd | |
| - name: Vet the SDK | |
| run: go vet ./... | |
| working-directory: sdks/go | |
| - name: Test the SDK | |
| run: go test -race ./... | |
| working-directory: sdks/go | |
| - name: Vet the terminal UI | |
| run: go vet ./... | |
| working-directory: tui | |
| - name: Test the terminal UI | |
| run: go test -race ./... | |
| working-directory: tui | |
| # Without the webrtc tag the load benchmark builds its transport as a stub, so its | |
| # ramp, report and audio checks are tested here without live calls. | |
| - name: Vet the load benchmark | |
| run: go vet ./... | |
| working-directory: performance_benchmark | |
| - name: Test the load benchmark | |
| run: go test ./... | |
| working-directory: performance_benchmark |