name: CI
on:
push:
branches: [main]
pull_request:
jobs:
rust-unit-tests:
name: Rust unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: cargo fmt --check
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
- name: cargo test
run: cargo test --lib --release
python-tests:
name: Python tests (${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install maturin + test deps
run: |
python -m pip install -U pip
pip install maturin pytest numpy scipy
- name: Build + install wheel
run: |
maturin build --release --out dist
pip install --no-index --find-links=dist rustmatrix
- name: Run tests (without pytmatrix — parity tests skipped)
run: pytest -v tests/