ci: derive postgres URL inline in test step
ci / gates (push) Successful in 21s
ci / rust (push) Failing after 1m4s
ci / frontend (push) Successful in 1m19s
ci / e2e (push) Has been skipped
ci / publish (push) Has been skipped

$GITHUB_ENV env-file writes appear to be dropped between steps under
act_runner v1.0.8 (tests pass locally with the same postgres setup, but
CI keeps failing at cargo test after ~3 min — consistent with the tests
trying to reach 127.0.0.1:54331 from .cargo/config.toml because the URL
override never landed).

Fix: re-inspect the sidecar container in the test step and export
CM_TEST_DATABASE_URL right before `cargo test`. PG_CONTAINER (just a
container name) still comes through $GITHUB_ENV — if that also fails
we'll surface it cleanly. Echoing the derived URL so we can verify from
runner logs on the next go-round.
This commit is contained in:
Omar Sobh
2026-07-05 09:18:32 -07:00
parent a89d961170
commit 4465797f3c
+10 -1
View File
@@ -72,7 +72,16 @@ jobs:
- name: Clippy - name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings run: cargo clippy --workspace --all-targets -- -D warnings
- name: Test - name: Test
run: cargo test --workspace run: |
set -euo pipefail
# Re-derive the postgres URL inline instead of trusting that
# CM_TEST_DATABASE_URL propagated through $GITHUB_ENV — act_runner
# v1.0.8 has been observed to swallow env-file writes here.
IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$PG_CONTAINER")
[ -n "$IP" ] || { echo "no PG IP" >&2; exit 1; }
export CM_TEST_DATABASE_URL="postgres://postgres:postgres@${IP}:5432/postgres"
echo "using $CM_TEST_DATABASE_URL"
cargo test --workspace
- name: Air-gapped installer verify path - name: Air-gapped installer verify path
run: ./ci/test-install.sh run: ./ci/test-install.sh
- name: Cleanup postgres sidecar - name: Cleanup postgres sidecar