From 9bdbcd4d88ebaddaf421c3ded6cc863691943163 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 1 May 2026 03:16:09 +0300 Subject: [PATCH] workflows: disable docker-clean so apt cache survives between runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .gitea/workflows/build.yml | 10 ++++++++++ .gitea/workflows/release.yml | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index e1b6ccf..cce3781 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -25,6 +25,11 @@ jobs: test: runs-on: go 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) run: | apt-get update >/dev/null @@ -61,6 +66,11 @@ jobs: runs-on: go needs: test 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) run: | apt-get update >/dev/null diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 4cd2b17..cba7e8f 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -16,6 +16,15 @@ jobs: release: runs-on: go 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) run: | apt-get update >/dev/null @@ -42,12 +51,13 @@ jobs: # Cache apt downloads — saves ~50s on the wine + innoextract install. # Bump the cache key (-v2, -v3, ...) when the package list changes. - name: Cache apt packages + id: apt-cache uses: actions/cache@v4 with: path: | /var/cache/apt/archives /var/lib/apt/lists - key: apt-trixie-wine-innoextract-v1 + key: apt-trixie-wine-innoextract-v2 - name: Extract version from tag id: version