Skip to content

Commit

Permalink
Use official setup-uv action and built-in caching
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook committed Jan 22, 2025
1 parent 01c15c6 commit 866de1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@ jobs:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

steps:
# Install prereqs and dependencies, with caching
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: yezz123/setup-uv@v4

# Cache packages per python version, and reuse until lockfile changes
- name: Cache python packages
id: cache
uses: actions/cache@v4
- uses: astral-sh/setup-uv@v5
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
enable-cache: true
cache-dependency-glob: uv.lock
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: uv sync
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ env.LATEST_PY_VERSION }}
- uses: yezz123/setup-uv@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Set pre-release version
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
Expand Down

0 comments on commit 866de1f

Please sign in to comment.