Skip to content

Commit

Permalink
github: workflow: Add build and test python binding
Browse files Browse the repository at this point in the history
Signed-off-by: Gaetan Perrot <[email protected]>
  • Loading branch information
moonlight83340 committed Aug 12, 2024
1 parent d44dc3f commit 747977e
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-test-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and test python
on: [push, pull_request]
jobs:
abi-check:
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

0 comments on commit 747977e

Please sign in to comment.