Skip to content

Commit

Permalink
add cache ci
Browse files Browse the repository at this point in the history
  • Loading branch information
samsja committed Dec 12, 2024
1 parent 3387a27 commit 84336f1
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,38 @@ jobs:
name: python
runs-on: self-hosted

env:
# Configure a constant location for the uv cache
UV_CACHE_DIR: /root/uv_cache/

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python
run: uv python install 3.10.13

- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install the project
run: uv sync --all-extras --dev

- name: Run tests
run: uv run pytest tests
run: uv run pytest tests

- name: Minimize uv cache
run: uv cache prune --ci

0 comments on commit 84336f1

Please sign in to comment.