mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-05-31 13:56:13 -07:00
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 <noreply@anthropic.com> * style: apply Prettier formatting to workflow files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
34
.github/workflows/build-tests-windows.yml
vendored
34
.github/workflows/build-tests-windows.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user