Skip to content

Commit

Permalink
Update build-test-python.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
moonlight83340 committed Aug 29, 2024
1 parent 149a50a commit 07bbf22
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/build-test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
buildsystem:
- meson
- cmake
use_rtable:
- true
- false
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -55,21 +58,30 @@ jobs:
- name: Build libcsp with python binding with meson
if: ${{ matrix.buildsystem == 'meson' }}
run: |
meson setup builddir -Denable_python3_bindings=true -Duse_rtable=true && ninja -C builddir
meson setup builddir -Denable_python3_bindings=true -Duse_rtable=${{ matrix.use_rtable }} && ninja -C builddir
- name: Run ZMQ Python binding Test
run: |
build/examples/zmqproxy &
PYTHONPATH=builddir python3 examples/python_bindings_example_server.py -z localhost -a 3 -R "0/0 ZMQHUB" &
PYTHONPATH=builddir python3 examples/python_bindings_example_client.py -z localhost -s 3 -a 2 -R "0/0 ZMQHUB"
if [ ${{ matrix.use_rtable }} == "true" ]; then
PYTHONPATH=builddir python3 examples/python_bindings_example_server.py -z localhost -a 3 -R "0/0 ZMQHUB" &
PYTHONPATH=builddir python3 examples/python_bindings_example_client.py -z localhost -s 3 -a 2 -R "0/0 ZMQHUB"
else
PYTHONPATH=builddir python3 examples/python_bindings_example_server.py -z localhost -a 3 &
PYTHONPATH=builddir python3 examples/python_bindings_example_client.py -z localhost -s 3 -a 2
fi
pkill zmqproxy
- name: Run KISS Python binding Test
run: |
socat -d -d -d pty,raw,echo=0,link=/tmp/pty1 pty,raw,echo=0,link=/tmp/pty2 &
sleep 1
PYTHONPATH=builddir python3 examples/python_bindings_example_server.py -k /tmp/pty2 -a 1 -R "0/0 KISS" &
PYTHONPATH=builddir python3 examples/python_bindings_example_client.py -k /tmp/pty1 -a 2 -s 1 -R "0/0 KISS"
if [ ${{ matrix.use_rtable }} == "true" ]; then
PYTHONPATH=builddir python3 examples/python_bindings_example_server.py -k /tmp/pty2 -a 1 -R "0/0 KISS" &
PYTHONPATH=builddir python3 examples/python_bindings_example_client.py -k /tmp/pty1 -a 2 -s 1 -R "0/0 KISS"
else
PYTHONPATH=builddir python3 examples/python_bindings_example_server.py -k /tmp/pty2 -a 1 &
PYTHONPATH=builddir python3 examples/python_bindings_example_client.py -k /tmp/pty1 -a 2 -s 1
pkill socat
- name: Setup vcan0
Expand All @@ -85,5 +97,10 @@ jobs:
- name: Run CAN Python binding Test
run: |
PYTHONPATH=builddir python3 examples/python_bindings_example_server.py -c vcan0 -a 1 -R "0/0 CAN" &
PYTHONPATH=builddir python3 examples/python_bindings_example_client.py -c vcan0 -a 2 -s 1 -R "0/0 CAN"
if [ ${{ matrix.use_rtable }} == "true" ]; then
PYTHONPATH=builddir python3 examples/python_bindings_example_server.py -c vcan0 -a 1 -R "0/0 CAN" &
PYTHONPATH=builddir python3 examples/python_bindings_example_client.py -c vcan0 -a 2 -s 1 -R "0/0 CAN"
else
PYTHONPATH=builddir python3 examples/python_bindings_example_server.py -c vcan0 -a 1 &
PYTHONPATH=builddir python3 examples/python_bindings_example_client.py -c vcan0 -a 2 -s 1
fi

0 comments on commit 07bbf22

Please sign in to comment.