From 122014edb38762acbf8c98edae0ce54d630b072b Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Mon, 13 Oct 2025 15:08:09 +0100 Subject: [PATCH] ci: Add `scope` parameter to `cache-{to,from}` options This change fixes an issue where only the latest image cache was available. --- .github/actions/run-in-docker-action/action.yml | 8 ++++++-- .github/workflows/ci.yml | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/actions/run-in-docker-action/action.yml b/.github/actions/run-in-docker-action/action.yml index 74933686..f9bd4746 100644 --- a/.github/actions/run-in-docker-action/action.yml +++ b/.github/actions/run-in-docker-action/action.yml @@ -7,6 +7,10 @@ inputs: tag: description: 'A tag of an image' required: true + scope: + description: 'A cached image scope' + required: false + default: ${{ runner.arch }} command: description: 'A command to run in a container' required: false @@ -24,7 +28,7 @@ runs: file: ${{ inputs.dockerfile }} tags: ${{ inputs.tag }} load: true - cache-from: type=gha + cache-from: type=gha,scope=${{ inputs.scope }} - uses: docker/build-push-action@v5 id: retry_builder @@ -34,7 +38,7 @@ runs: file: ${{ inputs.dockerfile }} tags: ${{ inputs.tag }} load: true - cache-from: type=gha + cache-from: type=gha,scope=${{ inputs.scope }} - # Workaround for https://github.com/google/sanitizers/issues/1614 . # The underlying issue has been fixed in clang 18.1.3. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9783251d..83b38240 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,8 +71,8 @@ jobs: with: file: ./ci/linux-debian.Dockerfile tags: ${{ matrix.arch }}-debian-image - cache-from: type=gha - cache-to: type=gha,mode=min + cache-from: type=gha,scope=${{ runner.arch }} + cache-to: type=gha,scope=${{ runner.arch }},mode=min x86_64-debian: name: "x86_64: Linux (Debian stable)"