fix: use correct array ops #1165
Workflow file for this run
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" | |
# A constant location for the uv cache | |
UV_CACHE_DIR: /tmp/.uv-cache | |
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 | |
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: ${{ 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 }} | |
- name: Install Guppy | |
run: uv sync | |
- 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 | |
- name: Minimize uv cache | |
run: uv cache prune --ci | |
test-coverage: | |
name: Check Python (3.12) with coverage | |
runs-on: ubuntu-latest | |
env: | |
PYTHON_VERSION: '3.12' | |
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 | |
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: ${{ 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 }} | |
- name: Install Guppy with execution and pytket | |
run: uv sync --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@v4 | |
with: | |
files: coverage.xml | |
name: python | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Minimize uv cache | |
run: uv cache prune --ci |