name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo clippy --all-targets --all-features -- -D warnings
- run: cargo test --all-features
- run: cargo test
- run: cargo package --no-verify
version-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Check version consistency (Cargo.toml / py/pyproject.toml / CITATION.cff)
run: |
RUST=$(grep '^version' Cargo.toml | head -1 | grep -oP '"\K[^"]+')
PY=$(grep '^version' py/pyproject.toml | grep -oP '"\K[^"]+')
CIT=$(grep '^version:' CITATION.cff | awk '{print $2}')
echo "Rust=$RUST Python=$PY Citation=$CIT"
[ "$RUST" = "$PY" ] && [ "$RUST" = "$CIT" ] || \
{ echo "ERROR: version mismatch — bump all three files together"; exit 1; }
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Build and test Python bindings
run: |
python -m venv .venv
.venv/bin/pip install maturin pytest
cd py && ../.venv/bin/maturin develop --features python
../.venv/bin/python -m pytest tests/