From db6d2318877812435249750818546e5410ce270d Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Tue, 28 Jul 2026 08:31:28 -0500 Subject: [PATCH] ci: add postgres health-check options, remove fragile /dev/tcp wait --- .forgejo/workflows/build.yaml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 56b974b3..bfa204c2 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -29,6 +29,11 @@ jobs: POSTGRES_PASSWORD: postgres ports: - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 steps: - name: Checkout code @@ -77,20 +82,6 @@ jobs: mix assets.setup && \ mix compile --warnings-as-errors' - - name: Wait for PostgreSQL - run: | - set -euo pipefail - for i in $(seq 1 30); do - if echo >/dev/tcp/localhost/5432 2>/dev/null; then - echo "PostgreSQL ready" - exit 0 - fi - echo "Waiting for PostgreSQL ($i/30)..." - sleep 2 - done - echo "PostgreSQL did not become ready" >&2 - exit 1 - - name: Run tests run: | set -euo pipefail