Skip to content

Factor out C-API, Python API and solver tests into their own crates #80

Factor out C-API, Python API and solver tests into their own crates

Factor out C-API, Python API and solver tests into their own crates #80

Workflow file for this run

name: RustSAT
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build-test:
name: Build and test
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: "build-test"
- name: Cargo build
run: cargo build -p rustsat --verbose --features=all
env:
CMAKE_BUILD_PARALLEL_LEVEL: ${{ fromJSON('["", "4"]')[matrix.os == 'macos-latest'] }}
- name: Cargo test
run: cargo test -p rustsat --verbose --features=all
env:
CMAKE_BUILD_PARALLEL_LEVEL: ${{ fromJSON('["", "4"]')[matrix.os == 'macos-latest'] }}
pystubs:
name: Test python stubs
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Install maturin from PyPI
uses: install-pinned/maturin@dfebcaa782a69944b584ec164e97fbbd09885352
- name: Install mypy from PyPI
uses: install-pinned/mypy@c2223951641cbb406fa8526d08f0690899f130e4
- name: Install python project
run: maturin build -m rustsat/Cargo.toml && pip install --no-index --find-links target/wheels/ rustsat
- name: Test stubs
run: stubtest --mypy-config-file rustsat/pyproject.toml --allowlist rustsat/stubtest-allowlist.txt rustsat
cbindgen:
name: Test generated C header
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Check C header
run: |
cargo install cbindgen
cbindgen -c rustsat/cbindgen.toml --crate rustsat -o rustsat/rustsat.h --verify