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