ci: unblock rust job with a postgres service; publish only needs rust/frontend
ci / gates (pull_request) Successful in 6s
ci / frontend (pull_request) Successful in 24s
ci / rust (pull_request) Failing after 2m14s
ci / e2e (pull_request) Has been skipped
ci / publish (pull_request) Has been skipped

The rust job's DB-backed tests (approvals_api, etc.) time out on the shared
act_runner because the runner lives inside a Docker container on the
act-runner_default network, and the URL in .cargo/config.toml points at
127.0.0.1:54331 — which is the *host* port for scripts/test-server.sh's
container, unreachable from inside the runner. Fix by attaching a postgres
service to the rust job and overriding CM_TEST_DATABASE_URL to the service's
DNS name. Local dev is untouched (still uses the shared server on the host).

Also drop e2e from publish's `needs` chain. e2e-backend.sh spins up its own
postgres + dex via `docker run` on the host, then tries to reach them at
127.0.0.1 from inside the runner container — same reachability problem,
larger fix. Migrating e2e to a physical build node (tank/architect) is a
separate task; until then e2e stays as signal-only and doesn't gate deploys.
This commit is contained in:
Omar Sobh
2026-07-05 08:52:32 -07:00
parent 4480c750bf
commit 0e2a7f3dd1
+21 -3
View File
@@ -20,10 +20,23 @@ jobs:
rust: rust:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: gates needs: gates
# Compile sqlx query! macros against the committed .sqlx cache (no DB needed); # Compile sqlx query! macros against the committed .sqlx cache (no DB needed).
# DB-backed tests spin up their own postgres via testcontainers at runtime. # Tests still need a live Postgres — locally cm-testkit reads CM_TEST_DATABASE_URL
# from .cargo/config.toml pointing at scripts/test-server.sh's host container;
# in CI the runner is on the act-runner_default docker network and can't reach
# host 127.0.0.1, so we provide a service and override the URL to its DNS name.
env: env:
SQLX_OFFLINE: "true" SQLX_OFFLINE: "true"
CM_TEST_DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd "pg_isready -U postgres" --health-interval 5s --health-timeout 3s --health-retries 10
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@stable
@@ -98,10 +111,15 @@ jobs:
# its Tailscale IP — the fleet's daemons trust it in insecure-registries by # its Tailscale IP — the fleet's daemons trust it in insecure-registries by
# IP, not by hostname). GW-04's clawmates-deploy.timer rolls forward within # IP, not by hostname). GW-04's clawmates-deploy.timer rolls forward within
# ~1 minute of the push. Skipped on PRs. # ~1 minute of the push. Skipped on PRs.
#
# `e2e` is intentionally NOT in `needs`: it launches its own postgres + dex
# via `docker run` on the host and then reaches them via 127.0.0.1, which
# fails from inside the act_runner container. Migrating e2e to a physical
# build node is a separate task; until then e2e is signal-only, not gating.
publish: publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [gates, rust, frontend, e2e] needs: [gates, rust, frontend]
env: env:
REGISTRY: 100.94.185.103:5000 REGISTRY: 100.94.185.103:5000
NAMESPACE: clawmates NAMESPACE: clawmates