forked from libcsp/libcsp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github: workflow: Add build and test python binding
Signed-off-by: Gaetan Perrot <[email protected]>
- Loading branch information
1 parent
d44dc3f
commit 8008455
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build and test python | ||
on: [push, pull_request] | ||
jobs: | ||
build-test-python: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-24.04 | ||
arch: | ||
- posix | ||
buildsystem: | ||
- cmake | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Setup packages on Linux | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install libzmq3-dev libsocketcan-dev | ||
- name: Setup build system packages on Linux | ||
run: | | ||
sudo apt-get install ninja-build cmake | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build libcsp examples | ||
run: python3 examples/buildall.py ${{ matrix.arch }} --build-system=${{ matrix.buildsystem }} | ||
|
||
- name: Build libcsp with python binding | ||
run: | | ||
cmake -GNinja -B buildBinding -DCSP_ENABLE_PYTHON3_BINDINGS=1 -DCSP_USE_RTABLE=1 -DCMAKE_POSITION_INDEPENDENT_CODE=ON && ninja -C buildBinding | ||
ls -l | ||
ls -l build/ | ||
- name: Run ZMQ Python binding Test | ||
run: | | ||
build/examples/zmqproxy & | ||
LD_LIBRARY_PATH=buildBinding PYTHONPATH=buildBinding python3 examples/python_bindings_example_server.py & | ||
LD_LIBRARY_PATH=buildBinding PYTHONPATH=buildBinding python3 examples/python_bindings_example_client.py -z localhost -s 27 -a 2 | ||
pkill zmqproxy |