diff --git a/CHANGELOG.md b/CHANGELOG.md index a56af1f..4daf46f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/action.yml b/action.yml index 893e78b..acb1e0c 100644 --- a/action.yml +++ b/action.yml @@ -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: >