From 09c4fa530075580d9f8a6b130ffd8a4333f50e1a Mon Sep 17 00:00:00 2001 From: Arnaud Date: Fri, 30 May 2025 11:55:35 +0200 Subject: [PATCH] Fix syntax --- .github/workflows/ci.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 095163e..1e976c2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,11 +16,10 @@ permissions: jobs: test: runs-on: ubuntu-latest - env: | - URL="http://localhost:8081/api/codex/v1/debug/info" - TIMEOUT_SECONDS=300 - SLEEP_INTERVAL=2 - MAX_RETRIES=$((TIMEOUT_SECONDS / SLEEP_INTERVAL)) + env: + URL: "http://localhost:8081/api/codex/v1/debug/info" + TIMEOUT_SECONDS: 300 + SLEEP_INTERVAL: 2 steps: - uses: actions/checkout@v4 @@ -37,16 +36,18 @@ jobs: - name: Wait for first SP to be started run: | + MAX_RETRIES=$((TIMEOUT_SECONDS / SLEEP_INTERVAL)) echo "Waiting for $URL (timeout: ${TIMEOUT_SECONDS}s)..." for i in $(seq 1 $MAX_RETRIES); do - STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$URL") - if [ "$STATUS" = "200" ]; then + STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$URL") + if [ "$STATUS" = "200" ]; then echo "Codex is ready" exit 0 - fi + fi - sleep $SLEEP_INTERVAL + echo "Waiting... HTTP status: $STATUS" + sleep $SLEEP_INTERVAL done echo "Timed out after ${TIMEOUT_SECONDS}s waiting for $URL"