neiam
/feedpug
feedpub
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
ci: reach postgres service by name (POSTGRES_HOST) under forgejo-runner
52bf4f7 · gmorell · 2026-07-02 02:50
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
@@ -14,7 +14,7 @@ config :feed_pug, Oban, testing: :manual
| 14 | 14 | config :feed_pug, FeedPug.Repo, |
| 15 | 15 | username: "postgres", |
| 16 | 16 | password: "postgres", |
| 17 | − hostname: "localhost", | |
| 17 | + hostname: System.get_env("POSTGRES_HOST") || "localhost", | |
| 18 | 18 | port: String.to_integer(System.get_env("DB_PORT") || "5432"), |
| 19 | 19 | database: "feed_pug_test#{System.get_env("MIX_TEST_PARTITION")}", |
| 20 | 20 | pool: Ecto.Adapters.SQL.Sandbox, |
Parents: 11cd47a