diff --git a/.github/workflows/build-test-python.yml b/.github/workflows/build-test-python.yml new file mode 100644 index 000000000..e5c3a7a63 --- /dev/null +++ b/.github/workflows/build-test-python.yml @@ -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 \ No newline at end of file