summaryrefslogtreecommitdiff
path: root/.github/workflows/container.yml
diff options
context:
space:
mode:
authorIvan Gabaldon <igabaldon@inetol.net>2025-08-07 16:53:37 +0200
committerGitHub <noreply@github.com>2025-08-07 16:53:37 +0200
commit4942c9b914d45dae9aadf193c97ddeb4acc8a466 (patch)
tree771a831e6b8298a2e7bb81a88e4d2daf946125fd /.github/workflows/container.yml
parent3de7a6da2dba72057a75d54b4b9fd864dee230e9 (diff)
[fix] ci: cache is not overwritten (#5089)
Due to current limitations of `actions/cache`, the cache cannot be overwritten. In our case, we need to accumulate cached wheels from different architectures. To solve this, we simply delete the key before storing the cache again.
Diffstat (limited to '.github/workflows/container.yml')
-rw-r--r--.github/workflows/container.yml24
1 files changed, 22 insertions, 2 deletions
diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml
index 496130edc..6369f1b7a 100644
--- a/.github/workflows/container.yml
+++ b/.github/workflows/container.yml
@@ -121,6 +121,8 @@ jobs:
permissions:
# Organization GHCR
packages: write
+ # Clean key cache step
+ actions: write
outputs:
docker_tag: ${{ steps.build.outputs.docker_tag }}
@@ -144,8 +146,9 @@ jobs:
restore-keys: "python-${{ env.PYTHON_VERSION }}-${{ runner.arch }}-"
path: "./local/"
- - name: Setup cache container mounts
- uses: actions/cache@v4
+ - name: Restore cache container mounts
+ id: cache-container-mounts
+ uses: actions/cache/restore@v4
with:
key: "container-mounts-${{ hashFiles('./container/*.dockerfile') }}"
restore-keys: "container-mounts-"
@@ -153,6 +156,14 @@ jobs:
/var/tmp/buildah-cache/
/var/tmp/buildah-cache-*/
+ # https://github.com/actions/cache/pull/1308
+ - if: steps.cache-container-mounts.outputs.cache-hit == 'true'
+ name: Clean key cache container mounts
+ continue-on-error: true
+ env:
+ GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
+ run: gh cache delete container-mounts-${{ hashFiles('./container/*.dockerfile') }}
+
- if: ${{ matrix.emulation }}
name: Setup QEMU
uses: docker/setup-qemu-action@v3
@@ -170,6 +181,15 @@ jobs:
OVERRIDE_ARCH: "${{ matrix.arch }}"
run: make podman.build
+ - if: always()
+ name: Save cache container mounts
+ uses: actions/cache/save@v4
+ with:
+ key: "container-mounts-${{ hashFiles('./container/*.dockerfile') }}"
+ path: |
+ /var/tmp/buildah-cache/
+ /var/tmp/buildah-cache-*/
+
test:
name: Test (${{ matrix.arch }})
runs-on: ${{ matrix.os }}