diff --git a/.github/workflows/daily-e2e-health.yaml b/.github/workflows/daily-e2e-health.yaml index e45fee1c..61d7f30c 100644 --- a/.github/workflows/daily-e2e-health.yaml +++ b/.github/workflows/daily-e2e-health.yaml @@ -73,10 +73,32 @@ jobs: run: | API_URL="${{ github.event.inputs.api_url || env.DEFAULT_API_URL }}" echo "πŸ”— ζͺ’ζŸ₯ API ε₯εΊ·η‹€ζ…‹..." - if curl -s --connect-timeout 10 "$API_URL/health" > /dev/null; then - echo "βœ… API 可用: $API_URL" + echo "πŸ“ Runner: $(hostname)" + echo "🌐 Target: $API_URL" + + # θ¨Ίζ–·ηΆ²θ·―ι€£ι€šζ€§ + VIP_IP=$(echo "$API_URL" | sed -E 's|https?://([^:]+).*|\1|') + echo "πŸ” Ping VIP ($VIP_IP)..." + ping -c 2 "$VIP_IP" || echo "⚠️ Ping failed (may be blocked)" + + # ε˜—θ©¦ι€£η·š + echo "πŸ”— Curl health endpoint..." + HTTP_CODE=$(curl -s -o /tmp/health_response.txt -w "%{http_code}" --connect-timeout 15 "$API_URL/health" || echo "000") + + if [ "$HTTP_CODE" = "200" ]; then + echo "βœ… API 可用: $API_URL (HTTP $HTTP_CODE)" + cat /tmp/health_response.txt else - echo "❌ API η„‘ζ³•ι€£η·š: $API_URL" + echo "❌ API η„‘ζ³•ι€£η·š: $API_URL (HTTP $HTTP_CODE)" + echo "πŸ“‹ Response:" + cat /tmp/health_response.txt 2>/dev/null || echo "(empty)" + + # ε˜—θ©¦ε‚™η”¨η«―ι»ž + FALLBACK_URL="http://192.168.0.120:32334" + echo "πŸ”„ ε˜—θ©¦ε‚™η”¨η«―ι»ž: $FALLBACK_URL" + FALLBACK_CODE=$(curl -s -o /dev/null -w "%{http_code}" --connect-timeout 10 "$FALLBACK_URL/health" || echo "000") + echo " ε‚™η”¨η΅ζžœ: HTTP $FALLBACK_CODE" + exit 1 fi