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