chore: Attempt at making execute_llvm editable in local uv
developm…
#1707
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull Request | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '**' | |
merge_group: | |
types: [checks_requested] | |
workflow_dispatch: {} | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
UV_VERSION: "0.4.27" | |
jobs: | |
check: | |
name: Check Python (3.10) | |
runs-on: ubuntu-latest | |
env: | |
PYTHON_VERSION: '3.10' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: install-llvm | |
run: "sudo apt-get update && sudo apt-get install -y llvm-14" | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v4 | |
with: | |
version: ${{ env.UV_VERSION }} | |
enable-cache: true | |
- name: Install Guppy | |
run: uv sync --frozen --python ${{ env.PYTHON_VERSION }} | |
- name: Type check with mypy | |
run: uv run mypy guppylang | |
- name: Check formatting with ruff | |
run: uv run ruff format --check guppylang | |
- name: Lint with ruff | |
run: uv run ruff check guppylang | |
- name: Install Guppy with llvm-based execution | |
run: uv sync --extra execution | |
- name: Cargo build validator | |
run: cargo build -p validator --release | |
- name: Run tests | |
run: uv run pytest | |
- name: Install tket2 dependencies | |
# This removes the `execution` extra group | |
run: uv sync --extra pytket | |
- 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 tests/integration/test_pytket_circuits.py | |
test-coverage: | |
name: Check Python (3.13) with coverage | |
runs-on: ubuntu-latest | |
env: | |
PYTHON_VERSION: '3.13' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v4 | |
with: | |
version: ${{ env.UV_VERSION }} | |
enable-cache: true | |
- name: Install Guppy with execution and pytket | |
run: uv sync --frozen --python ${{ env.PYTHON_VERSION }} --extra execution --extra pytket | |
- name: Cargo build validator | |
run: cargo build -p validator --release | |
- name: Run python tests with coverage instrumentation | |
run: uv run pytest --cov=./ --cov-report=xml | |
- name: Upload python coverage to codecov.io | |
uses: codecov/codecov-action@v5 | |
with: | |
files: coverage.xml | |
name: python | |
token: ${{ secrets.CODECOV_TOKEN }} |