diff --git a/.gitea/workflows/cicd.yml b/.gitea/workflows/cicd.yml index b156f41..c4a917b 100644 --- a/.gitea/workflows/cicd.yml +++ b/.gitea/workflows/cicd.yml @@ -606,19 +606,34 @@ jobs: run: | echo "=== Network-Resilient E2E Test Execution ===" - # Resilient docker pull - for i in 1 2 3; do - echo "Docker pull attempt $i/3..." - if timeout 300 docker pull dogar.darkhelm.org/darkhelm.org/plex-playlist/cicd:${GITHUB_SHA:-latest}; then - echo "✓ Docker pull successful" + # Enhanced resilient docker pull with aggressive retry logic + export DOCKER_CLI_EXPERIMENTAL=enabled + IMAGE_NAME="dogar.darkhelm.org/darkhelm.org/plex-playlist/cicd:${GITHUB_SHA:-latest}" + + for i in 1 2 3 4 5; do + echo "Enhanced Docker pull attempt $i/5..." + echo "Target image: $IMAGE_NAME" + + if timeout 1200 docker pull --platform linux/amd64 "$IMAGE_NAME"; then + echo "✓ Docker pull successful after $i attempts" break else - if [ $i -eq 3 ]; then - echo "❌ All docker pull attempts failed" - exit 1 + if [ $i -eq 5 ]; then + echo "❌ All enhanced docker pull attempts failed" + echo "Final attempt: Trying without platform specification..." + if timeout 1200 docker pull "$IMAGE_NAME"; then + echo "✓ Docker pull successful without platform specification" + break + else + echo "❌ Final fallback pull also failed" + exit 1 + fi fi - echo "⚠ Docker pull attempt $i failed, waiting 20s before retry..." - sleep 20 + echo "⚠ Enhanced pull attempt $i failed, cleaning up and retrying in 30s..." + # Clean up partial downloads and free space + docker system prune -f --volumes 2>/dev/null || true + docker rmi "$IMAGE_NAME" 2>/dev/null || true + sleep 30 fi done @@ -630,23 +645,33 @@ jobs: export CI=true && export NODE_ENV=test && - # Network-resilient Playwright setup + # Enhanced network-resilient Playwright setup echo 'Verifying Playwright installation...' && yarn playwright --version && - echo 'Installing Playwright browser binaries with retries...' && - for i in 1 2 3; do - echo \"Browser install attempt \$i/3...\" && - if timeout 600 yarn playwright install --with-deps; then - echo \"✓ Playwright browsers installed successfully\" && + echo 'Installing Playwright browser binaries with enhanced retries...' && + for i in 1 2 3 4; do + echo \"Enhanced browser install attempt \$i/4...\" && + # Use longer timeout and Chromium-only for CI reliability + if timeout 900 yarn playwright install --with-deps chromium; then + echo \"✓ Playwright Chromium browser installed successfully\" && break else - if [ \$i -eq 3 ]; then - echo \"❌ All browser install attempts failed\" && - exit 1 + if [ \$i -eq 4 ]; then + echo \"❌ All enhanced browser install attempts failed\" && + echo \"Attempting emergency fallback without dependencies...\" && + if timeout 600 yarn playwright install chromium; then + echo \"✓ Emergency fallback browser install successful\" && + break + else + echo \"❌ Emergency fallback also failed\" && + exit 1 + fi fi - echo \"⚠ Browser install attempt \$i failed, waiting 30s before retry...\" && - sleep 30 + echo \"⚠ Enhanced browser install attempt \$i failed, waiting 45s before retry...\" && + # Clear any partial browser downloads + rm -rf ~/.cache/ms-playwright 2>/dev/null || true && + sleep 45 fi done &&