-
-
Notifications
You must be signed in to change notification settings - Fork 361
76 lines (72 loc) · 2.32 KB
/
Copy pathpython-bindings.yml
File metadata and controls
76 lines (72 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Python bindings
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
CARGO_TERM_COLOR: always
# The engine package lives under python/rapier-py-3d (rapier3d, f32); the
# pure-Python testbed under python/rapier-testbed; the test suite under
# python/tests.
jobs:
lint-rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-lint-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-lint-
${{ runner.os }}-cargo-
- name: Cargo fmt
run: cargo fmt --check
- name: Cargo clippy (Python bindings)
run: |
cargo clippy --no-deps \
-p rapier-py-3d \
-- -D warnings
test:
needs: lint-rust
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-py-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-py-
${{ runner.os }}-cargo-
- name: Install tooling
run: |
python -m pip install --upgrade pip
python -m pip install maturin pytest pytest-timeout hypothesis numpy matplotlib
# Build + install the rapier3d (f32) engine package into the runner's
# environment so the test suite can import it.
- name: Build & install engine package
shell: bash
run: python -m pip install --no-build-isolation ./python/rapier-py-3d
- name: Install testbed (no deps; engine package already present)
shell: bash
run: python -m pip install --no-deps ./python/rapier-testbed
- name: Smoke (import surface)
run: python -m pytest python/tests/test_smoke.py python/tests/test_math.py -v
- name: Full test suite
run: python -m pytest python/tests/ -q --timeout=120