Skip to content

Commit

Permalink
ci: Use setup-uv action (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q authored Oct 4, 2024
1 parent 7083760 commit 9600411
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 48 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ concurrency:
group: "pages"
cancel-in-progress: true

env:
UV_CACHE_DIR: /tmp/.uv-cache

jobs:
build:
name: Build docs.
Expand All @@ -31,18 +28,12 @@ jobs:
uses: mozilla-actions/[email protected]

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.3.4/install.sh | 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: "0.4.18"
enable-cache: true
- name: Install Python
run: uv python install 3.10

- name: Build docs
run: |
Expand All @@ -53,9 +44,6 @@ jobs:
with:
path: ./docs/build/

- name: Minimize uv cache
run: uv cache prune --ci

publish:
name: Publish docs.
environment:
Expand Down
42 changes: 11 additions & 31 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ on:
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
# A constant location for the uv cache
UV_CACHE_DIR: /tmp/.uv-cache


jobs:
Expand All @@ -35,18 +33,12 @@ jobs:
run: "sudo apt-get update && sudo apt-get install -y llvm-14"

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.3.4/install.sh | sh
- name: "Set up Python"
uses: actions/setup-python@v5
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
- 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: "0.4.18"
enable-cache: true
- name: Install Python
run: uv python install ${{ env.PYTHON_VERSION }}

- name: Install Guppy
run: uv sync
Expand Down Expand Up @@ -76,9 +68,6 @@ jobs:
- name: Rerun `py(...)` expression tests and pytket lowering with tket2 installed
run: uv run pytest tests/integration/test_py.py tests/error/test_py_errors.py tests/integration/test_tket.py

- name: Minimize uv cache
run: uv cache prune --ci

test-coverage:
name: Check Python (3.12) with coverage
runs-on: ubuntu-latest
Expand All @@ -93,18 +82,12 @@ jobs:
uses: dtolnay/rust-toolchain@stable

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/0.3.4/install.sh | sh
- name: "Set up Python"
uses: actions/setup-python@v5
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
- 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: "0.4.18"
enable-cache: true
- name: Install Python
run: uv python install ${{ env.PYTHON_VERSION }}

- name: Install Guppy with execution and pytket
run: uv sync --extra execution --extra pytket
Expand All @@ -120,7 +103,4 @@ jobs:
with:
files: coverage.xml
name: python
token: ${{ secrets.CODECOV_TOKEN }}

- name: Minimize uv cache
run: uv cache prune --ci
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 9600411

Please sign in to comment.