diff --git a/.github/workflows/gpu.yml b/.github/workflows/gpu.yml index fb2ceec..933cd8b 100644 --- a/.github/workflows/gpu.yml +++ b/.github/workflows/gpu.yml @@ -13,13 +13,17 @@ 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" @@ -27,7 +31,20 @@ jobs: - 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 \ No newline at end of file + run: uv run pytest tests + + - name: Minimize uv cache + run: uv cache prune --ci \ No newline at end of file