From 1f3f172c151532f819f0d7b1680cf3a85f843746 Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Thu, 16 Apr 2026 10:53:39 +0000 Subject: [PATCH] ci: cache orchestrator-runtime image build via GHA cache The previous change moved `apt-get install curl sqlite3` from runtime into the Dockerfile, but still re-ran apt on every matrix job on every run. That still hits Canonical's mirror every time, and a PR already caught a ~116s hang on `archive.ubuntu.com` in one of the 12 matrix jobs (docker build exit 100). Switch to docker/build-push-action with type=gha cache. After the first successful build, subsequent jobs restore the image from the GitHub Actions cache and skip apt entirely unless the Dockerfile changes. --- .github/workflows/functional.yml | 39 +++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index dab57b2a..809083a8 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -55,9 +55,18 @@ jobs: - name: Make binary executable run: chmod +x bin/orchestrator + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build orchestrator runtime image - working-directory: tests/functional - run: docker build -t orchestrator-runtime:latest -f orchestrator-runtime.Dockerfile . + uses: docker/build-push-action@v6 + with: + context: tests/functional + file: tests/functional/orchestrator-runtime.Dockerfile + tags: orchestrator-runtime:latest + load: true + cache-from: type=gha,scope=orchestrator-runtime + cache-to: type=gha,mode=max,scope=orchestrator-runtime - name: Start test infrastructure (MySQL + ProxySQL) working-directory: tests/functional @@ -190,9 +199,18 @@ jobs: - name: Make binary executable run: chmod +x bin/orchestrator + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build orchestrator runtime image - working-directory: tests/functional - run: docker build -t orchestrator-runtime:latest -f orchestrator-runtime.Dockerfile . + uses: docker/build-push-action@v6 + with: + context: tests/functional + file: tests/functional/orchestrator-runtime.Dockerfile + tags: orchestrator-runtime:latest + load: true + cache-from: type=gha,scope=orchestrator-runtime + cache-to: type=gha,mode=max,scope=orchestrator-runtime - name: Start PostgreSQL containers working-directory: tests/functional @@ -315,9 +333,18 @@ jobs: - name: Make binary executable run: chmod +x bin/orchestrator + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build orchestrator runtime image - working-directory: tests/functional - run: docker build -t orchestrator-runtime:latest -f orchestrator-runtime.Dockerfile . + uses: docker/build-push-action@v6 + with: + context: tests/functional + file: tests/functional/orchestrator-runtime.Dockerfile + tags: orchestrator-runtime:latest + load: true + cache-from: type=gha,scope=orchestrator-runtime + cache-to: type=gha,mode=max,scope=orchestrator-runtime - name: Start MySQL infrastructure working-directory: tests/functional