workflows: disable docker-clean so apt cache survives between runs
Debian-based Docker images install /etc/apt/apt.conf.d/docker-clean which runs 'apt-get clean' after every apt-get install — wipes out /var/cache/apt/archives so there's nothing for actions/cache to save. Fix: remove the docker-clean drop-in and add keep-cache config first thing in each job, before any apt activity. Also bump apt cache key to v2 since the previous v1 was always empty. Wait time on the Wine + Inno Setup step should drop from ~1m20s to ~10s on warm runs (debs already in /var/cache/apt/archives, dpkg just installs them locally). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,11 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: go
|
runs-on: go
|
||||||
steps:
|
steps:
|
||||||
|
- name: Disable apt auto-clean (preserve cache for actions/cache)
|
||||||
|
run: |
|
||||||
|
rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
|
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
|
||||||
|
|
||||||
- name: Install Node (required by actions/cache)
|
- name: Install Node (required by actions/cache)
|
||||||
run: |
|
run: |
|
||||||
apt-get update >/dev/null
|
apt-get update >/dev/null
|
||||||
@@ -61,6 +66,11 @@ jobs:
|
|||||||
runs-on: go
|
runs-on: go
|
||||||
needs: test
|
needs: test
|
||||||
steps:
|
steps:
|
||||||
|
- name: Disable apt auto-clean (preserve cache for actions/cache)
|
||||||
|
run: |
|
||||||
|
rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
|
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
|
||||||
|
|
||||||
- name: Install Node (required by actions/cache)
|
- name: Install Node (required by actions/cache)
|
||||||
run: |
|
run: |
|
||||||
apt-get update >/dev/null
|
apt-get update >/dev/null
|
||||||
|
|||||||
@@ -16,6 +16,15 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
runs-on: go
|
runs-on: go
|
||||||
steps:
|
steps:
|
||||||
|
# Debian-based Docker images ship /etc/apt/apt.conf.d/docker-clean
|
||||||
|
# which deletes /var/cache/apt/archives after every apt-get install.
|
||||||
|
# That defeats actions/cache for the apt cache; disable it before
|
||||||
|
# any apt operations.
|
||||||
|
- name: Disable apt auto-clean (preserve cache for actions/cache)
|
||||||
|
run: |
|
||||||
|
rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
|
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
|
||||||
|
|
||||||
- name: Install Node (required by actions/cache)
|
- name: Install Node (required by actions/cache)
|
||||||
run: |
|
run: |
|
||||||
apt-get update >/dev/null
|
apt-get update >/dev/null
|
||||||
@@ -42,12 +51,13 @@ jobs:
|
|||||||
# Cache apt downloads — saves ~50s on the wine + innoextract install.
|
# Cache apt downloads — saves ~50s on the wine + innoextract install.
|
||||||
# Bump the cache key (-v2, -v3, ...) when the package list changes.
|
# Bump the cache key (-v2, -v3, ...) when the package list changes.
|
||||||
- name: Cache apt packages
|
- name: Cache apt packages
|
||||||
|
id: apt-cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
/var/cache/apt/archives
|
/var/cache/apt/archives
|
||||||
/var/lib/apt/lists
|
/var/lib/apt/lists
|
||||||
key: apt-trixie-wine-innoextract-v1
|
key: apt-trixie-wine-innoextract-v2
|
||||||
|
|
||||||
- name: Extract version from tag
|
- name: Extract version from tag
|
||||||
id: version
|
id: version
|
||||||
|
|||||||
Reference in New Issue
Block a user