-
Notifications
You must be signed in to change notification settings - Fork 36
110 lines (109 loc) · 3.55 KB
/
unit_tests.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: unit_tests
on:
push:
branches: [ main, 'rbus-**' ]
pull_request:
branches: [ main, 'rbus-**' ]
jobs:
all:
runs-on: ubuntu-latest
steps:
- name: Set up cache
id: cache
uses: actions/cache@v3
with:
path: |
build
install
key: ${{ runner.os }}-${{ github.sha }}
- name: Set up CMake
# 3.16.x To support flow control commands to be overridden.
# Installs in: find /opt -ipath *bin/cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'
- name: Install packages
run: >
sudo apt update && sudo apt install -y libcurl4-openssl-dev libgtest-dev lcov gcovr
- name: Checkout rbus
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
path: rbus
- name: Configure Rbus
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/rbus"
-B build/rbus
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DBUILD_FOR_DESKTOP=ON
-DENABLE_UNIT_TESTING=ON
-DENABLE_CODE_COVERAGE=ON
-DCMAKE_BUILD_TYPE=Debug
- name: Build Rbus
if: steps.cache.outputs.cache-hit != 'true'
run: >
make -C build/rbus
- name: Install rbus
if: steps.cache.outputs.cache-hit != 'true'
run: >
make -C build/rbus install
- name: Start rtrouted
# nohup to keep it running.
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
nohup ./bin/rtrouted -f -l DEBUG > /tmp/rtrouted_log.txt &
- name: Run Unit test
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
nohup ./bin/rbusTestProvider >/tmp/plog.txt &
./bin/rbusTestConsumer -a
- name: Run multiRbusOpenMethod Unit Test
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
./bin/multiRbusOpenMethodProvider &
./bin/multiRbusOpenMethodConsumer &
- name: Run multiRbusOpenSubscribe Unit test
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
nohup ./bin/multiRbusOpenProvider >/tmp/log_multiRbusOpenProvider.txt &
./bin/multiRbusOpenConsumer
- name: Run multiRbusOpenGet Unit test
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
nohup ./bin/multiRbusOpenRbusGetProvider >/tmp/log_multiRbusOpenRbusGetProvider.txt &
./bin/multiRbusOpenRbusGetConsumer
- name: Run multiRbusOpenSet Unit test
run: |
cd install/usr
export PREFIX=$PWD
export LD_LIBRARY_PATH=$PREFIX/lib
nohup ./bin/multiRbusOpenRbusGetProvider >/tmp/log_multiRbusOpenRbusSetProvider.txt &
./bin/multiRbusOpenRbusSetConsumer
- name: Run Gtest Cases
run: |
cd build/rbus
nohup ./src/session_manager/rbus_session_mgr &
./unittests/rbus_gtest.bin
- name: Stop SessionManager
run: |
killall -9 rbus_session_mgr
- name: Stop rtrouted
run: |
killall -9 rtrouted
- name: Run CodeCoverage
run: |
rm -rf /tmp/rtrouted*
cd build/rbus
make rbusCodeCoverageUI