ci: reach postgres service by name (POSTGRES_HOST) under forgejo-runner

4837430 · gmorell · 2026-07-02 02:50

5 files +4 -1

Files changed

modified .github/workflows/ci.yml
+3 −0
@@ -14,6 +14,9 @@ jobs:
14 14 runs-on: arc-runner-set
15 15 env:
16 16 MIX_ENV: test
17 + # Under forgejo-runner/act the job runs in a container, so the postgres
18 + # service is reached by its service name, not localhost.
19 + POSTGRES_HOST: postgres
17 20 # Cap the test DB pool below the Postgres service's default
18 21 # max_connections (100); big CI runners otherwise scale pool to cores×2
19 22 # and exhaust connections.
modified config/test.exs
+1 −1
@@ -8,7 +8,7 @@ import Config
8 8 config :waxx, Waxx.Repo,
9 9 username: "postgres",
10 10 password: "postgres",
11 − hostname: "localhost",
11 + hostname: System.get_env("POSTGRES_HOST") || "localhost",
12 12 port: 54328,
13 13 database: "waxx_test#{System.get_env("MIX_TEST_PARTITION")}",
14 14 pool: Ecto.Adapters.SQL.Sandbox,

Parents: 3376ed2