Skip to content

Commit 88c1e70

Browse files
committed
Use latest version of uv action which has automatic caching.
Simplify HF model caching - it's not OS dependant.
1 parent 958f048 commit 88c1e70

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,19 @@ jobs:
2222
python-version: ${{ matrix.python-version }}
2323

2424
- name: Install uv
25-
uses: astral-sh/setup-uv@v3
26-
27-
- name: Cache uv dependencies
28-
uses: actions/cache@v4
29-
with:
30-
path: ~/.cache/uv
31-
key: ${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
32-
restore-keys: |
33-
${{ runner.os }}-uv-${{ matrix.python-version }}-
34-
${{ runner.os }}-uv-
25+
uses: astral-sh/setup-uv@v6
26+
# uv v6 automatically caches dependencies on GitHub-hosted runners
27+
# No manual caching needed for uv packages/wheels
3528

3629
- name: Cache Hugging Face models
3730
uses: actions/cache@v4
3831
with:
3932
path: ~/.cache/huggingface
40-
key: ${{ runner.os }}-huggingface-${{ hashFiles('**/pyproject.toml') }}
41-
restore-keys: |
42-
${{ runner.os }}-huggingface-
33+
key: huggingface-models-v1
4334

4435
- name: Run tests
4536
run: |
37+
# --locked ensures we use exact versions from uv.lock without updating
4638
uv run --locked pytest tests/ -v
4739
env:
4840
HF_HUB_CACHE: ~/.cache/huggingface
@@ -59,25 +51,19 @@ jobs:
5951
python-version: "3.11"
6052

6153
- name: Install uv
62-
uses: astral-sh/setup-uv@v3
63-
64-
- name: Cache uv dependencies
65-
uses: actions/cache@v4
66-
with:
67-
path: ~/.cache/uv
68-
key: ${{ runner.os }}-uv-lint-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
69-
restore-keys: |
70-
${{ runner.os }}-uv-lint-
71-
${{ runner.os }}-uv-
54+
uses: astral-sh/setup-uv@v6
7255

7356
- name: Check code with ruff
7457
run: |
58+
# --locked ensures we use exact versions from uv.lock without updating
7559
uv run --locked ruff check .
7660
7761
- name: Check imports with ruff
7862
run: |
63+
# --locked ensures we use exact versions from uv.lock without updating
7964
uv run --locked ruff check --select I .
8065
8166
- name: Check code formatting with ruff
8267
run: |
68+
# --locked ensures we use exact versions from uv.lock without updating
8369
uv run --locked ruff format --check .

0 commit comments

Comments
 (0)