From 4a7fc08e6344299761acd5293b086f920664bd4d Mon Sep 17 00:00:00 2001 From: Frostebite Date: Sat, 28 Mar 2026 21:43:13 +0000 Subject: [PATCH] Fix failing windows builds in CI (#820) * ci(windows): add Docker daemon readiness check before build Add a proactive Docker daemon health check step to the Windows build workflow. The windows-2022 runner images sometimes have the Docker service in a stopped or starting state, causing the first build attempt to fail on Docker operations. The new step polls the Docker service for up to 60 seconds, actively starting it if stopped, before proceeding to the build. This is faster and more diagnostic than relying solely on the existing retry loop (which sleeps 120-240s between full re-runs of the action). The existing retry pattern is kept as defense-in-depth since it also handles non-Docker transient failures (Unity licensing, network, etc). Ref: actions/runner-images#13729 Co-Authored-By: Claude Opus 4.6 * style: apply Prettier formatting to workflow files Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- .github/workflows/build-tests-windows.yml | 34 +++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-tests-windows.yml b/.github/workflows/build-tests-windows.yml index 72948f0a..1d322660 100644 --- a/.github/workflows/build-tests-windows.yml +++ b/.github/workflows/build-tests-windows.yml @@ -39,7 +39,7 @@ jobs: - unityVersion: 6000.0.36f1 targetPlatform: StandaloneWindows64 buildProfile: 'Assets/Settings/Build Profiles/Sample Windows Build Profile.asset' - + steps: ########################### # Checkout # @@ -66,6 +66,34 @@ jobs: run: | Move-Item -Path "./test-project/ProjectSettings/ProjectSettingsIl2cpp.asset" -Destination "./test-project/ProjectSettings/ProjectSettings.asset" -Force + ########################### + # Docker Readiness # + ########################### + - name: Ensure Docker daemon is ready + timeout-minutes: 2 + shell: powershell + run: | + $maxRetries = 10 + $retryDelay = 6 + for ($i = 0; $i -lt $maxRetries; $i++) { + $svc = Get-Service docker -ErrorAction SilentlyContinue + if ($svc -and $svc.Status -eq 'Running') { + docker version 2>$null + if ($LASTEXITCODE -eq 0) { + Write-Host "Docker is ready." + exit 0 + } + } + if ($svc -and $svc.Status -eq 'Stopped') { + Write-Host "Docker service stopped, attempting to start..." + Start-Service docker -ErrorAction SilentlyContinue + } + Write-Host "Waiting for Docker daemon (attempt $($i+1)/$maxRetries)..." + Start-Sleep -Seconds $retryDelay + } + Write-Error "Docker daemon did not start within $($maxRetries * $retryDelay) seconds" + exit 1 + ########################### # Build # ########################### @@ -146,6 +174,8 @@ jobs: ########################### - uses: actions/upload-artifact@v4 with: - name: Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})${{ matrix.enableGpu && ' With GPU' || '' }}${{ matrix.buildProfile && ' With Build Profile' || '' }} + name: + Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})${{ matrix.enableGpu && ' With + GPU' || '' }}${{ matrix.buildProfile && ' With Build Profile' || '' }} path: build retention-days: 14