Skip to content

Commit

Permalink
ci: colocate uv cache on same drive
Browse files Browse the repository at this point in the history
Saving cache to D:\ is more performant than C:\
since workspace is located on D: drive.

Also hardlink does not work on different partitions.
  • Loading branch information
skshetry committed Sep 9, 2024
1 parent 7b8922b commit 589a9a3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ jobs:
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-local-path: ${{ runner.os == 'Windows' && 'C:\Users\runner-admin\AppData\uv\cache' || '/tmp/uv-cache' }}
- run: uv pip install -e ".[dev]" --system
env:
UV_LINK_MODE: ${{ runner.os == 'Windows' && 'symlink' || 'hardlink' }}

- name: Cache mypy
uses: actions/cache@v4
with:
path: .mypy_cache
key: mypy-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- uses: pre-commit/action@v3.0.1
- run: uv cache prune --ci -vv

tests:
timeout-minutes: 20
Expand Down Expand Up @@ -87,14 +87,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyv }}
- run: pip install uv
- run: uv cache dir
- uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
cache-local-path: ${{ runner.os == 'Windows' && 'C:\Users\runner-admin\AppData\uv\cache' || '/tmp/uv-cache' }}
cache-suffix: ${{ matrix.pyv }}
- run: uv pip install -e ".[dev]" pytest-split --system
env:
UV_LINK_MODE: ${{ runner.os == 'Windows' && 'symlink' || 'hardlink' }}

- name: run tests
timeout-minutes: 40
Expand Down

0 comments on commit 589a9a3

Please sign in to comment.