From 331f10fb07d29a3451a780c29cc9c24821ad9cfc Mon Sep 17 00:00:00 2001 From: Lars Bogner Date: Wed, 26 Aug 2026 13:08:26 +0200 Subject: [PATCH] Prune the uv cache at the end of every CI job The uv cache lives on a persistent volume shared by every job on the runner (/srv/act-runner-cache/uv), so nothing trimmed it and it grew without bound. `uv cache prune --ci` drops the entries that are not worth keeping between runs (pre-built wheels for local sources) while leaving the downloaded-wheel cache that makes `uv sync` fast. In bump-version the step carries the same is_merge guard as the rest of that job, since uv is only set up on a merge push. Co-Authored-By: Claude Opus 5 --- .gitea/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 1f62d7c..351101c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -28,6 +28,9 @@ jobs: echo "UV_LINK_MODE=copy" >> "$GITHUB_ENV" - run: uv sync --extra cpu --extra dev - run: uv run ruff check . + # The uv cache is a persistent volume shared by every job on this + # runner, so each job trims what it no longer needs before exiting. + - run: uv cache prune --ci ruff-format: name: Format (ruff format) @@ -46,6 +49,7 @@ jobs: echo "UV_LINK_MODE=copy" >> "$GITHUB_ENV" - run: uv sync --extra cpu --extra dev - run: uv run ruff format --check . + - run: uv cache prune --ci type-check: name: Type check (ty) @@ -64,6 +68,7 @@ jobs: echo "UV_LINK_MODE=copy" >> "$GITHUB_ENV" - run: uv sync --extra cpu --extra dev - run: uv run ty check . + - run: uv cache prune --ci test: name: Tests @@ -87,6 +92,7 @@ jobs: with: name: coverage-report path: coverage.xml + - run: uv cache prune --ci bump-version: name: Bump version, tag, and update changelog on merge to master @@ -173,6 +179,10 @@ jobs: git tag -a "$TAG" -m "$TAG" git push origin "refs/tags/$TAG" fi + # Same guard as every other step here: on a non-merge push uv was never + # set up, so there is nothing to prune. + - run: uv cache prune --ci + if: steps.merge_check.outputs.is_merge == 'true' sync-version-on-tag: name: Sync project version with tag @@ -201,3 +211,4 @@ jobs: else echo "Tag version matches project version ($CURRENT_VERSION)" fi + - run: uv cache prune --ci