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

0154741 · 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
@@ -11,7 +11,7 @@ config :bcrypt_elixir, :log_rounds, 1
11 11 config :diogramos, Diogramos.Repo,
12 12 username: "postgres",
13 13 password: "postgres",
14 − hostname: "localhost",
14 + hostname: System.get_env("POSTGRES_HOST") || "localhost",
15 15 port: 54329,
16 16 database: "diogramos_test#{System.get_env("MIX_TEST_PARTITION")}",
17 17 pool: Ecto.Adapters.SQL.Sandbox,

Parents: 781e447