forked from libcsp/libcsp
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (63 loc) · 2.44 KB
/
build-test-python.yml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Python Bindings
on: [push, pull_request]
jobs:
build-test-python:
strategy:
fail-fast: false
matrix:
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
buildsystem:
- meson
- cmake
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup packages on Linux
run: |
sudo apt-get update
sudo apt-get install libzmq3-dev libsocketcan-dev socat
- name: Setup build system packages on Linux
run: |
sudo apt-get install ninja-build ${{ matrix.buildsystem }}
- name: Checkout
uses: actions/checkout@v4
- name: Build libcsp examples
run: python3 examples/buildall.py --build-system=${{ matrix.buildsystem }}
- name: Build libcsp with python binding with cmake
if: ${{ matrix.buildsystem == 'cmake' }}
run: |
cmake -GNinja -B builddir -DCSP_ENABLE_PYTHON3_BINDINGS=1 -DCSP_USE_RTABLE=1 && ninja -C builddir
- name: Install the latest Meson using Pip if Python is 3.12 or later
# Meson 1.3+ supports Python 3.12 (distutils removed)
if: ${{ matrix.buildsystem == 'meson' && matrix.python-version == '3.12' }}
run: |
pip install meson
meson --version
- 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
- name: Run ZMQ Python binding Test
run: |
build/examples/zmqproxy &
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
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 &
PYTHONPATH=builddir python3 examples/python_bindings_example_client.py -k /tmp/pty1 -a 2 -s 1
pkill socat