Skip to content

Commit 3d7ef7c

Browse files
committed
fix .github/workflows/build-macos.yml
1 parent 7a96166 commit 3d7ef7c

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/build-macos.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,28 @@ jobs:
5252
with:
5353
python-version: ${{ matrix.python-version }}
5454

55-
5655
- name: Install uv
5756
# https://docs.astral.sh/uv/guides/integration/github/#caching
5857
uses: astral-sh/setup-uv@v6
5958
with:
6059
version: "latest"
6160

61+
- name: Compute uv hash
62+
id: uvhash
63+
run: |
64+
hash="$(sha1sum pyproject.toml 2>/dev/null || echo '')"
65+
lock="$(sha1sum uv.lock 2>/dev/null || echo '')"
66+
echo "UV_HASH=$hash$lock"
67+
echo "UV_HASH=$hash$lock" >> $GITHUB_ENV
68+
6269
- name: Cache uv
6370
uses: actions/cache@v4
71+
env:
72+
KEY_BASE: ${{ runner.os }}-uv-${{ matrix.python-version }}-
6473
with:
6574
path: ~/.cache/uv
66-
key: >-
67-
${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'uv.lock') }}
68-
restore-keys: |
69-
${{ runner.os }}-uv-${{ matrix.python-version }}-
75+
key: ${{ env.KEY_BASE }}${{ env.UV_HASH }}
76+
restore-keys: ${{ env.KEY_BASE }}
7077

7178
- name: Create venv
7279
run: |

0 commit comments

Comments
 (0)