Skip to content

feat: bring multibodies on par with Rapier #86

feat: bring multibodies on par with Rapier

feat: bring multibodies on par with Rapier #86

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
# NOTE: don't set a global `RUSTFLAGS: --deny warnings`: the shader crates
# compile under cargo-gpu's own (nightly) toolchain, which inherits RUSTFLAGS
# and would fail on warnings we don't control. Strict linting of our own code
# is enforced through `cargo clippy ... -- --deny warnings` instead.
jobs:
# Check formatting.
format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check
# Run clippy lints.
clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends build-essential curl wget file libssl-dev
- name: Install cargo-gpu (rust-gpu shader compiler)
run: cargo install cargo-gpu --version 0.10.0-alpha.1
- name: Install the rust-gpu toolchain
run: cargo gpu install --auto-install-rust-toolchain
- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: Run clippy lints
run: cargo clippy --workspace --all-targets -- --deny warnings
# Check documentation.
doc:
name: Docs
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends build-essential curl wget file libssl-dev
- name: Install cargo-gpu (rust-gpu shader compiler)
run: cargo install cargo-gpu --version 0.10.0-alpha.1
- name: Install the rust-gpu toolchain
run: cargo gpu install --auto-install-rust-toolchain
- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
# `nexus_python3d` is excluded: its lib is named `nexus3d` (the Python
# module name), which collides with the `nexus3d` crate's doc output. The
# bindings are covered by the dedicated python job.
- name: Check documentation
run: cargo doc --workspace --exclude nexus_python3d --document-private-items --no-deps
env:
RUSTDOCFLAGS: --deny warnings
# Testing.
test:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
build-essential curl wget file libssl-dev \
libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- name: Install cargo-gpu (rust-gpu shader compiler)
run: cargo install cargo-gpu --version 0.10.0-alpha.1
- name: Install the rust-gpu toolchain
run: cargo gpu install --auto-install-rust-toolchain
- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
# `nexus_python3d` is excluded: pyo3's `extension-module` feature leaves
# the Python symbols unresolved, so its test binaries cannot link. The
# bindings are covered by the dedicated python job.
- name: Run Cargo Tests
run: LIBGL_ALWAYS_SOFTWARE=1 cargo test --workspace --exclude nexus_python3d --verbose
# Build the Python bindings (`nexus3d`) into a wheel and import-check it.
python:
name: Python bindings
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
build-essential curl wget file libssl-dev \
libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- name: Install cargo-gpu (rust-gpu shader compiler)
run: cargo install cargo-gpu --version 0.10.0-alpha.1
- name: Install the rust-gpu toolchain
run: cargo gpu install --auto-install-rust-toolchain
- name: Install maturin
run: pip install maturin
- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v2
with:
sweep-cache: true
- name: Clippy (bindings crate)
run: cargo clippy --package nexus_python3d --no-deps -- --deny warnings
- name: Build wheel and import-check
run: |
maturin build -m crates/nexus_python3d/Cargo.toml --out dist
pip install --no-index --find-links dist dimforge-nexus3d
python -c "import nexus3d; print('nexus3d import OK')"