Skip to content

Commit 5194f6c

Browse files
authored
fix: warm cache pre-commit and uv cache path bugs (#1389)
## Summary - Fix `pre-commit: command not found` in warmDepsCache — pre-commit is inside hatch's default env, use `hatch run pre-commit install-hooks` - Fix UV cache path mismatch — `setup-uv` overrides `UV_CACHE_DIR` to a temp path, but cache save/restore uses `~/.cache/uv`. Pin `UV_CACHE_DIR: /home/runner/.cache/uv` in job env so `setup-uv` respects it and paths align. ## Test plan > Note: I had done a temp change to trigger `warmDepsCache` on the PR for testing - [x] Verify warmDepsCache run succeeds [Ref](https://github.com/databricks/dbt-databricks/actions/runs/24276657026/job/70891669261?pr=1389) - [x] Verify that we have correct artifacts uploaded - confirmed using github API - [x] All existing tests pass
1 parent b0778e0 commit 5194f6c

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252

5353
env:
5454
UV_FROZEN: "1"
55+
UV_CACHE_DIR: /home/runner/.cache/uv
5556

5657
steps:
5758
- name: Check out the repository
@@ -99,6 +100,7 @@ jobs:
99100

100101
env:
101102
UV_FROZEN: "1"
103+
UV_CACHE_DIR: /home/runner/.cache/uv
102104

103105
strategy:
104106
fail-fast: false
@@ -154,6 +156,7 @@ jobs:
154156

155157
env:
156158
UV_FROZEN: "1"
159+
UV_CACHE_DIR: /home/runner/.cache/uv
157160

158161
steps:
159162
- name: Check out the repository

.github/workflows/warmDepsCache.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818
- "uv.lock"
1919
- "pyproject.toml"
2020
- ".pre-commit-config.yaml"
21+
pull_request: # TEMPORARY: remove after testing
2122
schedule:
2223
- cron: "0 6 * * *" # Daily at 06:00 UTC
2324
workflow_dispatch:
@@ -40,6 +41,9 @@ jobs:
4041

4142
env:
4243
UV_FROZEN: "1"
44+
# Pin cache dir so setup-uv doesn't override it to a temp path.
45+
# Must match the path in setup-python-deps/action.yml cache restore.
46+
UV_CACHE_DIR: /home/runner/.cache/uv
4347

4448
steps:
4549
- name: Checkout main branch
@@ -95,7 +99,7 @@ jobs:
9599
hatch env create verify
96100
97101
- name: Warm pre-commit cache
98-
run: pre-commit install-hooks
102+
run: hatch run pre-commit install-hooks
99103

100104
- name: Build and warm pip cache for verify environment
101105
run: |

0 commit comments

Comments
 (0)