forked from rdkcentral/networkmanager
-
Notifications
You must be signed in to change notification settings - Fork 0
203 lines (186 loc) · 6.66 KB
/
L1-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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: l1-test
on:
push:
branches: [ main, develop, 'topic/**']
pull_request:
branches: [ main, develop]
env:
BUILD_TYPE: Debug
THUNDER_REF: "R4.4.1"
THUNDER_TOOLS_REF: "R4.4.1"
INTERFACES_REF: "R4.4.1"
jobs:
l1-tests:
name: Build and run unit tests
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [ gcc, clang ]
coverage: [ with-coverage, without-coverage ]
exclude:
- compiler: clang
coverage: with-coverage
- compiler: clang
coverage: without-coverage
- compiler: gcc
coverage: without-coverage
steps:
- name: Set up cache
# Cache Thunder/ThunderInterfaces.
# https://github.com/actions/cache
# https://docs.github.com/en/rest/actions/cache
# Modify the key if changing the list.
if: ${{ !env.ACT }}
id: cache
uses: actions/cache@v3
with:
path: |
build/Thunder
build/ThunderInterfaces
build/ThunderTools
install
!install/etc/WPEFramework/plugins
!install/usr/bin/RdkServicesL1Test
!install/usr/include/gmock
!install/usr/include/gtest
!install/usr/lib/libgmockd.a
!install/usr/lib/libgmock_maind.a
!install/usr/lib/libgtestd.a
!install/usr/lib/libgtest_maind.a
!install/usr/lib/cmake/GTest
!install/usr/lib/pkgconfig/gmock.pc
!install/usr/lib/pkgconfig/gmock_main.pc
!install/usr/lib/pkgconfig/gtest.pc
!install/usr/lib/pkgconfig/gtest_main.pc
!install/usr/lib/wpeframework/plugins
key: ${{ runner.os }}-${{ env.THUNDER_REF }}-${{ env.INTERFACES_REF }}-3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: pip install jsonref
- name: Set up CMake
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.x'
- name: Install packages
run: >
sudo apt update
&&
sudo apt install -y libnm0 git pkg-config ninja-build libssl-dev libglib2.0-dev libnm-dev libcurl4-openssl-dev valgrind lcov clang
- name: Checkout ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: rdkcentral/ThunderTools
path: ThunderTools
ref: ${{env.THUNDER_TOOLS_REF}}
- name: Build ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/ThunderTools"
-B build/ThunderTools
-DEXCEPTIONS_ENABLE=ON
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DGENERIC_CMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
&&
cmake --build build/ThunderTools -j8
&&
cmake --install build/ThunderTools
- name: Checkout Thunder
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: rdkcentral/Thunder
path: Thunder
ref: ${{env.THUNDER_REF}}
- name: Build Thunder
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/Thunder"
-B build/Thunder
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DBUILD_TYPE=${{env.BUILD_TYPE}}
-DBINDING=127.0.0.1
-DPORT=55555
-DEXCEPTIONS_ENABLE=ON
&&
cmake --build build/Thunder -j8
&&
cmake --install build/Thunder
- name: Checkout ThunderInterfaces
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: rdkcentral/ThunderInterfaces
path: ThunderInterfaces
ref: ${{env.INTERFACES_REF}}
- name: Build ThunderInterfaces
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
-S "${{github.workspace}}/ThunderInterfaces"
-B build/ThunderInterfaces
-DEXCEPTIONS_ENABLE=ON
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
&&
cmake --build build/ThunderInterfaces -j8
&&
cmake --install build/ThunderInterfaces
- name: Checkout networkmanager
uses: actions/checkout@v3
with:
path: networkmanager
- name: Generate external headers
# Empty headers to mute errors
run: >
cd "${{github.workspace}}/networkmanager/Tests/"
&&
mkdir -p
headers
headers/rdk/iarmbus
headers/network
&&
cd headers
&&
touch
rdk/iarmbus/libIARM.h
rdk/iarmbus/libIBus.h
rdk/iarmbus/libIBusDaemon.h
network/wifiSrvMgrIarmIf.h
network/netsrvmgrIarm.h
- name: Set clang toolchain
if: ${{ matrix.compiler == 'clang' }}
run: echo "TOOLCHAIN_FILE=${{github.workspace}}/networkmanager/Tests/clang.cmake" >> $GITHUB_ENV
- name: Set gcc/with-coverage toolchain
if: ${{ matrix.compiler == 'gcc' && matrix.coverage == 'with-coverage' && !env.ACT }}
run: echo "TOOLCHAIN_FILE=${{github.workspace}}/networkmanager/Tests/gcc-with-coverage.cmake" >> $GITHUB_ENV
- name: Build NetworkManager
run: >
cmake
-S "${{github.workspace}}/networkmanager"
-B build/networkmanager
-DCMAKE_TOOLCHAIN_FILE="${{ env.TOOLCHAIN_FILE }}"
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install/usr"
-DCMAKE_MODULE_PATH="${{github.workspace}}/install/tools/cmake"
-DCMAKE_CXX_FLAGS="
-fprofile-arcs
-ftest-coverage
-DEXCEPTIONS_ENABLE=ON
-I ${{github.workspace}}/networkmanagerTests/headers
-I ${{github.workspace}}/networkmanager/Tests/headers/rdk/iarmbus
-I ${{github.workspace}}/networkmanager/Tests/headers/network
-Wall -Werror -Wno-error=format=
-Wl,-wrap,system -Wl,-wrap,popen -Wl,-wrap,syslog"
-DCMAKE_DISABLE_FIND_PACKAGE_IARMBus=ON
-DENABLE_GNOME_NETWORKMANAGER=OFF
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
&&
cmake --build build/networkmanager -j16
&&
cmake --install build/networkmanager