From 8fb45e9d027cc3768a05b1f42518d08bfe335daa Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 31 Jul 2024 12:42:56 -0400 Subject: [PATCH] Add caching of uv dependencies (#208) --- .github/workflows/test.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index acdcd3e5..e5f9ddbd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -37,6 +37,9 @@ jobs: runs-on: ${{ matrix.os }} timeout-minutes: 10 + env: + UV_CACHE_DIR: /tmp/.uv-cache + steps: - uses: actions/checkout@v4 @@ -49,6 +52,15 @@ jobs: with: python-version: ${{ matrix.python-version }} + - 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 packages run: | uv sync --all-extras --dev @@ -56,3 +68,6 @@ jobs: - name: Run tests run: | uv run -- pytest tests + + - name: Minimize uv cache + run: uv cache prune --ci