diff --git a/.github/workflows/cache-verify.yml b/.github/workflows/cache-verify.yml index f27325159..8036179e9 100644 --- a/.github/workflows/cache-verify.yml +++ b/.github/workflows/cache-verify.yml @@ -177,6 +177,7 @@ jobs: runs-on: ubuntu-latest env: jobs: 8 + PATH: "/opt:${PATH}" strategy: matrix: job: [1, 2, 3, 4, 5, 6, 7, 8] @@ -232,16 +233,32 @@ jobs: run: | docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach backend mailserver webapp - - name: Wait for services + - name: Wait for essential services run: | - for i in {1..60}; do - curl -sf http://localhost:3000 && echo "✅ Webapp ready" && break - echo "Waiting... ($i/60)" - sleep 2 - done - echo "❌ Timeout: webapp did not start in time" - docker compose logs - exit 1 + wait_for() { + local name="$1" + local url="$2" + echo "⏳ Waiting for $name ($url)..." + for i in {1..60}; do + if curl -sf "$url" > /dev/null; then + echo "✅ $name is ready" + return 0 + fi + echo "Waiting for $name... ($i/60)" + sleep 2 + done + echo "❌ Timeout: $name did not respond at $url" + docker compose logs "$name" + return 1 + } + + # Check each essential service + wait_for "webapp" "http://localhost:3000" + wait_for "backend" "http://localhost:4000/api/health" + wait_for "mailserver" "http://localhost:1080" + wait_for "minio" "http://localhost:9000/minio/health/live" + + echo "🎉 All services are up." - name: Full stack tests | run tests id: e2e-tests