forked from libcsp/libcsp
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (76 loc) · 2.53 KB
/
build-test.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
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Build and Test
on: [push, pull_request]
jobs:
run-tests:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- ubuntu-20.04
#- macos-latest
arch:
- posix
buildsystem:
- meson
- cmake
- waf
compiler:
- CC: gcc
CXX: g++
- CC: clang
CXX: clang++
runs-on: ${{ matrix.os }}
steps:
- name: Setup packages on Linux
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install libzmq3-dev libsocketcan-dev socat
- name: Setup build system packages on Linux
if: ${{ runner.os == 'Linux' && matrix.buildsystem != 'waf' }}
run: |
sudo apt-get install ninja-build ${{ matrix.buildsystem }}
- name: Setup packages on MacOS
if: ${{ runner.os == 'macOS' && matrix.buildsystem != 'waf' }}
run: |
brew update
brew install ninja ${{ matrix.buildsystem }}
brew install zeromq
- name: Checkout
uses: actions/checkout@v4
- name: Build
env:
CC: ${{ matrix.compiler.CC }}
CXX: ${{ matrix.compiler.CXX }}
run: python3 ./examples/buildall.py ${{ matrix.arch }} --build-system=${{ matrix.buildsystem }}
- name: Run Loopback Test
run: |
./build/examples/csp_arch
./build/examples/csp_server_client -T 10
- name: Run KISS Client Test
run: |
socat -d -d -d pty,raw,echo=0,link=/tmp/pty1 pty,raw,echo=0,link=/tmp/pty2 &
sleep 1
./build/examples/csp_server -k /tmp/pty1 -a 1 -T 10 &
./build/examples/csp_client -k /tmp/pty2 -a 2 -C 1 -t
pkill socat
- name: Run KISS Server Test
run: |
socat -d -d -d pty,raw,echo=0,link=/tmp/pty1 pty,raw,echo=0,link=/tmp/pty2 &
sleep 1
./build/examples/csp_client -k /tmp/pty2 -a 2 -C 1 -T 10 &
./build/examples/csp_server -k /tmp/pty1 -a 1 -t
pkill socat
- name: Run ZMQ Client Test
run: |
./build/examples/zmqproxy &
./build/examples/csp_server -z localhost -a 1 -T 10 &
./build/examples/csp_client -z localhost -a 2 -C 1 -t
pkill zmqproxy
- name: Run ZMQ Server Test
run: |
./build/examples/zmqproxy &
./build/examples/csp_client -z localhost -a 2 -C 1 -T 10 &
./build/examples/csp_server -z localhost -a 1 -t
pkill zmqproxy