|
1 | 1 | name: 'Setup UV with Cache' |
2 | | -description: 'Install UV and restore cached environment' |
| 2 | +description: 'Install UV with its native wheel cache (enable-cache) and install deps' |
3 | 3 | inputs: |
4 | 4 | cache-key: |
5 | | - description: 'Cache key for UV environment' |
6 | | - required: true |
| 5 | + description: 'Unused — kept for caller compatibility; setup-uv manages its own cache.' |
| 6 | + required: false |
| 7 | + default: '' |
7 | 8 | fail-on-cache-miss: |
8 | | - description: 'Whether to fail if cache is not found' |
| 9 | + description: 'Unused — kept for caller compatibility.' |
9 | 10 | required: false |
10 | | - default: 'true' |
| 11 | + default: 'false' |
11 | 12 |
|
12 | 13 | runs: |
13 | 14 | using: 'composite' |
14 | 15 | steps: |
| 16 | + # Pin the interpreter BEFORE uv so uv never tries to fetch/build a Python. |
| 17 | + - name: Set up Python |
| 18 | + uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 |
| 19 | + with: |
| 20 | + python-version: '3.12' |
| 21 | + |
| 22 | + # setup-uv's native cache keys on the uv.lock hash and caches UV_CACHE_DIR |
| 23 | + # (the wheel/download cache uv actually uses). Warm cache → link, not download. |
15 | 24 | - name: Install UV |
16 | 25 | uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 |
17 | | - |
18 | | - - name: Restore UV environment |
19 | | - id: restore-cache |
20 | | - uses: actions/cache/restore@a7833574556fa59680c1b7cb190c1735db73ebf0 # v5.0.0 |
21 | 26 | with: |
22 | | - path: | |
23 | | - .venv |
24 | | - ~/.cache/uv |
25 | | - ~/.local/bin/uv |
26 | | - /opt/hostedtoolcache/uv |
27 | | - key: ${{ inputs.cache-key }} |
28 | | - fail-on-cache-miss: ${{ inputs.fail-on-cache-miss }} |
| 27 | + version: "0.9.6" |
| 28 | + enable-cache: true |
| 29 | + cache-dependency-glob: "uv.lock" |
29 | 30 |
|
30 | | - - name: Install dependencies if cache miss |
31 | | - if: steps.restore-cache.outputs.cache-hit != 'true' |
| 31 | + # ORB_SKIP_UI_BUILD is CRITICAL: `uv sync` builds the orb-py package, which |
| 32 | + # runs setup.py's build_py hook → build_ui.sh (reflex export + bun) → the |
| 33 | + # full SPA build. On a cold uv cache that rebuild fires and takes >30 min, |
| 34 | + # timing the job out. Test jobs don't need the SPA, so skip it here. |
| 35 | + - name: Install dependencies |
32 | 36 | shell: bash |
33 | | - run: make dev-install |
| 37 | + env: |
| 38 | + ORB_SKIP_UI_BUILD: "1" |
| 39 | + run: uv sync --frozen --all-groups |
0 commit comments