-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 1.12 KB
/
Copy pathbuild_python.yml
File metadata and controls
34 lines (29 loc) · 1.12 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
name: Rust-Python
on:
push:
branches: [ "main", "develop", "staging" ]
pull_request:
branches: [ "main", "develop", "staging" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Rust
run: sudo apt-get install cargo && rustup override set 1.81
- name: Set up Python
run: sudo apt-get install python3 python3-dev
- uses: actions/checkout@v4
- name: Set up a Python virtual environment (needed for maturin)
run: python3 -m venv ./venv
- name: Install Python deps
run: ./venv/bin/pip3 install -r ./lib-py/requirements.txt
- name: Build the Rust library, install it as a Python module
run: cd lib-py && VIRTUAL_ENV='../venv' ../venv/bin/maturin develop && cd ..
- name: Run the Python sample app
run: cd samples/python && ../../venv/bin/python main.py && cd ../..
- name: Run the Python test (Python interface)
run: cd samples/python && ../../venv/bin/python test_lib.py && cd ../..
- name: Run the Python test (C interface)
run: cd samples/python && ../../venv/bin/python test_lib_c.py && cd ../..