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
# Python binding: build the wheel, install it and run python/tests/test_binding.py
# against the installed module (a built wheel is not a tested one). One ubuntu job
# with a debug build, only when the engine, the binding or this workflow change;
# release.yml runs the same tests on the release wheels of every OS.
name: Python binding
on:
push:
branches:
paths:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'python/**'
- '.github/workflows/python-binding.yml'
pull_request:
branches:
paths:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'python/**'
- '.github/workflows/python-binding.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
wheel:
name: Build, install and test the wheel
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: python-binding
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Build the wheel
run: |
python -m pip install maturin
maturin build --features python --out dist/
- name: Install the wheel and run the binding tests
run: |
python -m pip install numpy dist/*.whl
python python/tests/test_binding.py