name: CI
on:
push:
branches: [master, main]
pull_request:
workflow_call:
workflow_dispatch:
jobs:
test:
name: rust tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
repository: MolCrafts/molrs
path: molrs
- uses: actions/checkout@v6
with:
path: molpack
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: molpack
- name: Cache test data
uses: actions/cache@v5
with:
path: molrs/molrs-core/target/tests-data
key: ${{ runner.os }}-test-data-${{ hashFiles('molrs/scripts/fetch-test-data.sh') }}
- name: Fetch test data
run: bash scripts/fetch-test-data.sh
working-directory: molrs
- name: Test (library + integration + examples)
run: cargo test --features io --lib --tests --examples
working-directory: molpack
- name: Test CLI (cli feature)
run: cargo test --test cli --features cli
working-directory: molpack
- name: Feature-gate checks (no-default-features / rayon / ff)
run: |
cargo check --no-default-features
cargo check --features rayon
cargo check --features ff
working-directory: molpack
- name: Build benches (rot guard)
run: cargo build --benches
working-directory: molpack
regression:
name: packmol regression
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v6
with:
repository: MolCrafts/molrs
path: molrs
- uses: actions/checkout@v6
with:
path: molpack
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: molpack
- name: Run examples_batch (--ignored)
run: cargo test --release --features io --test examples_batch -- --ignored
working-directory: molpack
python:
name: python tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
repository: MolCrafts/molrs
path: molrs
- uses: actions/checkout@v6
with:
path: molpack
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: molpack
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v6
- name: Build + test Python bindings
run: |
uv venv
source .venv/bin/activate
uv pip install --group dev
maturin develop --release
pytest -v
working-directory: molpack/python