@@ -268,8 +268,14 @@ jobs:
268268 runs-on : macos-13
269269 needs : [ BuildMockLoginConsentServer, BuilMockTrustRegistryServer, BuilMockAttestationServer, BuildMockSampleWebhookServer ]
270270 timeout-minutes : 60
271+
272+ # NEW: ensure every step talks to the Colima daemon
273+ env :
274+ DOCKER_HOST : unix:///Users/runner/.colima/default/docker.sock
275+ DOCKER_BUILDKIT : " 1"
276+
271277 steps :
272- # CHANGED: fetch tags to avoid "No names found" from git describe
278+ # Fetch tags so your version script doesn't print "No names found"
273279 - name : Checkout
274280 uses : actions/checkout@v4
275281 with :
@@ -281,12 +287,10 @@ jobs:
281287 with :
282288 go-version : ${{ env.GO_VERSION }}
283289
284- # NEW: ensure Go can verify toolchains & use proxy (safe no-op if already set)
285290 - name : Configure Go env (proxy & sumdb)
286291 run : |
287292 go env -w GOSUMDB=sum.golang.org
288293 go env -w GOPROXY="https://proxy.golang.org,direct"
289- go env
290294
291295 - name : Generate and copy Android Binding
292296 run : |
@@ -302,18 +306,17 @@ jobs:
302306 NEW_VERSION=testVer GIT_REV=testRev BUILD_TIME=testTime make generate-android-bindings copy-android-bindings
303307 env :
304308 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
305- # keep GOPATH local to the workspace so gomobile's bin is accessible
306309 GOPATH : ${{ github.workspace }}/.gopath
307310
308311 - name : Setup hosts
309312 run : |
310- echo '127.0.0.1 file-server.trustbloc.local' | sudo tee -a /etc/hosts
311- echo '127.0.0.1 did-resolver.trustbloc.local' | sudo tee -a /etc/hosts
312- echo '127.0.0.1 vc-rest-echo.trustbloc.local' | sudo tee -a /etc/hosts
313- echo '127.0.0.1 api-gateway.trustbloc.local' | sudo tee -a /etc/hosts
314- echo '127.0.0.1 cognito-mock.trustbloc.local' | sudo tee -a /etc/hosts
313+ echo '127.0.0.1 file-server.trustbloc.local' | sudo tee -a /etc/hosts
314+ echo '127.0.0.1 did-resolver.trustbloc.local' | sudo tee -a /etc/hosts
315+ echo '127.0.0.1 vc-rest-echo.trustbloc.local' | sudo tee -a /etc/hosts
316+ echo '127.0.0.1 api-gateway.trustbloc.local' | sudo tee -a /etc/hosts
317+ echo '127.0.0.1 cognito-mock.trustbloc.local' | sudo tee -a /etc/hosts
315318
316- # CHANGED: replace flaky action with direct Colima install/start
319+ # Install Docker CLI and start Colima
317320 - name : Install Docker (Colima) on macOS
318321 env :
319322 HOMEBREW_NO_INSTALL_CLEANUP : " 1"
@@ -325,10 +328,31 @@ jobs:
325328 brew update
326329 brew install colima docker docker-buildx
327330 colima start --cpu 4 --memory 8 --disk 20
331+ # Select context (persists in ~/.docker)
328332 docker context use colima
333+ # Wait until the engine is REALLY ready
334+ for i in {1..60}; do
335+ if docker info >/dev/null 2>&1; then
336+ break
337+ fi
338+ sleep 2
339+ done
329340 docker version
330341 docker info
331342
343+ # NEW: double-check Docker before image loads (handles rare races/crashes)
344+ - name : Ensure Docker is up (Colima)
345+ run : |
346+ colima status || colima start --cpu 4 --memory 8 --disk 20
347+ for i in {1..60}; do
348+ if docker info >/dev/null 2>&1; then
349+ break
350+ fi
351+ sleep 2
352+ done
353+ docker context inspect
354+ echo "Docker is ready."
355+
332356 - name : Download artifacts (Docker images) from previous workflows
333357 uses : actions/download-artifact@v4
334358
@@ -389,7 +413,17 @@ jobs:
389413 docker images
390414 docker ps -a
391415
392- # NEW: tidy up the VM
416+ # Helpful logs if anything Docker/Colima fails
417+ - name : Colima diagnostics
418+ if : failure()
419+ run : |
420+ set -x
421+ colima status || true
422+ colima list || true
423+ colima logs --last 200 || true
424+ docker context ls || true
425+ docker info || true
426+
393427 - name : Stop Colima
394428 if : always()
395429 run : colima stop || true
0 commit comments