Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uv cache busting #115

Merged
merged 4 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased](https://github.com/hynek/build-and-inspect-python-package/compare/v2.2.1...main)

### Added

- Cache busting for the *uv* cache.
GitHub Actions's caching behavior is a bit idiosyncratic:
Once a cache is created, it's immutable.
But as long as it's accessed within 7 days, it never goes away.

Therefore, *baipp* now uses the hash of the requirements file as part of the cache key.
Behaviorally, nothing changes, except that the cache doesn't grow useless over time.
[#115](https://github.com/hynek/build-and-inspect-python-package/pull/115)


## [2.2.1](https://github.com/hynek/build-and-inspect-python-package/compare/v2.2.0...v2.2.1) - 2024-04-02

Expand Down
9 changes: 6 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,18 @@ runs:
run: curl -LsSf https://astral.sh/uv/install.sh | sh
shell: bash

- name: Find uv cache
run: echo "UV_CACHE=$(uv cache dir)" >>$GITHUB_ENV
- name: Find uv cache and hash lock file
run: |
echo "UV_CACHE=$(uv cache dir)" >>$GITHUB_ENV

echo "REQS_HASH=$(sha256sum ${{ github.action_path }}/requirements/tools.txt | cut -d' ' -f1)" >>$GITHUB_ENV
shell: bash

- name: Cache uv
uses: actions/cache@v4
with:
path: ${{ env.UV_CACHE }}
key: ${{ runner.os }}-uv
key: baipp-${{ env.REQS_HASH }}

- name: Create venv for tools
run: >
Expand Down