Skip to content

Commit

Permalink
ci: Update ci.yml to use Python version in UV cache
Browse files Browse the repository at this point in the history
  • Loading branch information
MountainGod2 committed Nov 1, 2024
1 parent e13ae8d commit 2cd48cd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ on:
branches:
- main

env:
UV_CACHE_DIR: /tmp/.uv-cache-${{ matrix.python-version }}

jobs:
ci:
name: Run Tests, Linting, and Build Documentation
Expand All @@ -38,15 +35,19 @@ jobs:
- name: Restore UV Cache
uses: actions/[email protected]
with:
path: ${{ env.UV_CACHE_DIR }}
path: /tmp/.uv-cache-${{ matrix.python-version }}
key: "uv-${{ matrix.python-version }}-${{ runner.os }}-${{ hashFiles('uv.lock') }}"
restore-keys: |
uv-${{ matrix.python-version }}-${{ runner.os }}
- name: Install Dependencies and Sync Project
env:
UV_CACHE_DIR: /tmp/.uv-cache-${{ matrix.python-version }}
run: uv sync

- name: Run Formatting, Linting, Type Checks, and Tests
env:
UV_CACHE_DIR: /tmp/.uv-cache-${{ matrix.python-version }}
run: |
uv run ruff format ./
uv run ruff check --fix ./
Expand All @@ -68,6 +69,8 @@ jobs:
fail_ci_if_error: true

- name: Build Documentation
env:
UV_CACHE_DIR: /tmp/.uv-cache-${{ matrix.python-version }}
run: uv run --group=docs make clean html --directory docs/

- name: Upload Documentation to GitHub Pages
Expand All @@ -77,4 +80,6 @@ jobs:
publish_dir: docs/_build/html

- name: Minimize UV Cache
env:
UV_CACHE_DIR: /tmp/.uv-cache-${{ matrix.python-version }}
run: uv cache prune --ci

0 comments on commit 2cd48cd

Please sign in to comment.