Skip to content

Commit

Permalink
ci: Use setup-uv action (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q authored Oct 4, 2024
1 parent ed18752 commit 2027a3b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 41 deletions.
8 changes: 0 additions & 8 deletions .github/script/install-uv.sh

This file was deleted.

39 changes: 12 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ env:
CI: true # insta snapshots behave differently on ci
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
UV_CACHE_DIR: /tmp/.uv-cache
# Pinned version for the uv package manager
UV_VERSION: "0.4.18"

jobs:
# Check if changes were made to the relevant files.
Expand Down Expand Up @@ -84,18 +85,12 @@ jobs:
- uses: actions/checkout@v4
- uses: mozilla-actions/sccache-action@v0.0.6
- name: Set up uv
run: .github/script/install-uv.sh
- name: "Set up Python"
uses: actions/setup-python@v5
uses: astral-sh/setup-uv@v3
with:
python-version: '3.12'
- name: Restore uv cache
uses: actions/cache@v4
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install Python 3.12
run: uv python install 3.12
- name: Setup dependencies
run: uv sync --locked
- name: Type check with mypy
Expand All @@ -104,8 +99,6 @@ jobs:
run: uv run ruff format --check
- name: Lint with ruff
run: uv run ruff check
- name: Minimize uv cache
run: uv cache prune --ci

benches:
name: Build benchmarks 🏋️
Expand Down Expand Up @@ -234,18 +227,12 @@ jobs:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set up uv
run: .github/script/install-uv.sh
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Restore uv cache
uses: actions/cache@v4
uses: astral-sh/setup-uv@v3
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install Python 3.10
run: uv python install 3.10
- name: Setup dependencies
run: uv sync --locked
- name: Run python tests with coverage instrumentation
Expand All @@ -255,8 +242,6 @@ jobs:
with:
name: py-coverage
path: coverage.xml
- name: Minimize uv cache
run: uv cache prune --ci

coverage-py:
name: Upload Python coverage 🐍
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/python-pure-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ on:
types:
- published

env:
# Pinned version for the uv package manager
UV_VERSION: "0.4.18"

jobs:
build-publish:
name: Package and publish wheels
Expand Down Expand Up @@ -45,13 +49,12 @@ jobs:


- name: Set up uv
if: ${{ steps.check-tag.outputs.run == 'true' }}
run: .github/script/install-uv.sh
- name: Set up Python
if: ${{ steps.check-tag.outputs.run == 'true' }}
uses: actions/setup-python@v5
uses: astral-sh/setup-uv@v3
with:
python-version: '3.12'
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install Python 3.12
run: uv python install 3.12

- name: Build sdist and wheels
if: ${{ steps.check-tag.outputs.run == 'true' }}
Expand Down

0 comments on commit 2027a3b

Please sign in to comment.