ci: reach postgres at container port 5432 (POSTGRES_PORT), not the published host port

4ae2807 · gmorell · 2026-07-03 00:26

5 files +3 -1

Files changed

modified .github/workflows/ci.yml
+2 −0
@@ -17,6 +17,8 @@ jobs:
17 17 # Under forgejo-runner/act the job runs in a container, so the postgres
18 18 # service is reached by its service name, not localhost.
19 19 POSTGRES_HOST: postgres
20 + # service is reached at its container port under forgejo-runner
21 + POSTGRES_PORT: 5432
20 22 # Cap the test DB pool below the Postgres service's default
21 23 # max_connections (100); big CI runners otherwise scale pool to cores×2
22 24 # and exhaust connections.
modified config/test.exs
+1 −1
@@ -9,7 +9,7 @@ config :waxx, Waxx.Repo,
9 9 username: "postgres",
10 10 password: "postgres",
11 11 hostname: System.get_env("POSTGRES_HOST") || "localhost",
12 − port: 54328,
12 + port: String.to_integer(System.get_env("POSTGRES_PORT") || "54328"),
13 13 database: "waxx_test#{System.get_env("MIX_TEST_PARTITION")}",
14 14 pool: Ecto.Adapters.SQL.Sandbox,
15 15 # One sandbox connection per concurrent async test. On a many-core CI runner

Parents: d0d3355