name: CI
on:
push: { branches: [main] }
pull_request:
jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with: { components: "rustfmt, clippy" }
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo clippy --all-targets -- -D warnings
- run: cargo test
- run: cargo test --doc
- run: cargo doc --no-deps
env: { RUSTDOCFLAGS: "-D warnings" }
python:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check -p geomcore-py
- uses: actions/setup-python@v5
with: { python-version: "${{ matrix.python-version }}" }
- run: pip install maturin pytest mypy
- run: maturin build --manifest-path geomcore-py/Cargo.toml --out dist
- run: pip install --no-index --find-links dist geomcore
- run: pytest geomcore-py/tests
- if: matrix.python-version == '3.12'
run: python -m mypy.stubtest geomcore --allowlist geomcore-py/stubtest-allowlist.txt