mirror of
https://github.com/searxng/searxng.git
synced 2025-08-13 23:36:45 +02:00
[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.
This commit is contained in:
parent
3de7a6da2d
commit
4942c9b914
1 changed files with 22 additions and 2 deletions
24
.github/workflows/container.yml
vendored
24
.github/workflows/container.yml
vendored
|
@ -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 }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue