forked from open62541/open62541
-
Notifications
You must be signed in to change notification settings - Fork 0
314 lines (280 loc) · 14 KB
/
build_linux.yml
File metadata and controls
314 lines (280 loc) · 14 KB
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
name: Linux Build & Test
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
build:
- name: "Debug Build & Unit Tests (gcc)"
cmd_action: unit_tests
- name: "Debug Build & Unit Tests (gcc, 32bit)"
cmd_deps: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y -qq gcc-multilib libsubunit-dev:i386 check:i386 libxml2-dev:i386
cmd_action: unit_tests_32
- name: "Debug Build & Unit Tests without Subscriptions (gcc)"
cmd_action: unit_tests_nosub
- name: "Debug Build & Unit Tests with Diagnostics (gcc)"
cmd_action: unit_tests_diag
- name: "Debug Build & Unit Tests with multithreading (gcc)"
cmd_action: unit_tests_mt
- name: "Debug Build & Unit Tests with Alarms&Conditions (gcc)"
cmd_action: unit_tests_alarms
- name: "Debug Build & Unit Tests (tcc)"
cmd_deps: sudo apt-get install -y -qq tcc
cmd_action: CC=tcc unit_tests
- name: "Encryption (MbedTLS) Build & Unit Tests (gcc)"
cmd_deps: sudo apt-get install -y -qq libmbedtls-dev
cmd_action: unit_tests_encryption MBEDTLS
- name: "PubSub Encryption (MbedTLS) Build & Unit Tests (gcc)"
cmd_deps: sudo apt-get install -y -qq libmbedtls-dev
cmd_action: unit_tests_encryption_mbedtls_pubsub
- name: "PubSub SKS Build & Unit Tests (gcc)"
cmd_deps: sudo apt-get install -y -qq valgrind libmbedtls-dev
cmd_action: unit_tests_pubsub_sks
- name: "Encryption (OpenSSL) Build & Unit Tests (gcc)"
cmd_deps: sudo apt-get install -y -qq openssl
cmd_action: unit_tests_encryption OPENSSL
- name: "Encryption (LibreSSL) Build & Unit Tests (gcc)"
cmd_deps: |
sudo apt-get install -y -qq curl
curl https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-4.1.0.tar.gz --output libressl.tar.gz
tar -xvz -f libressl.tar.gz
cd libressl-4.1.0
./configure
sudo make install
cmd_action: unit_tests_encryption LIBRESSL
- name: "Release Build"
cmd_deps: sudo apt-get install -y -qq libmbedtls-dev
cmd_action: build_release
- name: "Amalgamation Build"
cmd_action: build_amalgamation
- name: "Amalgamation Build with Multithreading"
cmd_action: build_amalgamation_mt
- name: "Build All Companion Specifications"
cmd_action: build_all_companion_specs
include:
# Clang builds for specific Ubuntu versions
- os: ubuntu-20.04
build:
name: "Debug Build & Unit Tests (clang-11)"
cmd_deps: sudo apt-get install -y -qq clang-11 clang-tools-11
cmd_action: CC=clang-11 CXX=clang++-11 unit_tests
- os: ubuntu-22.04
build:
name: "Debug Build & Unit Tests (clang-15)"
cmd_deps: sudo apt-get install -y -qq clang-15 clang-tools-15 && sudo sysctl -w vm.mmap_rnd_bits=28
cmd_action: CC=clang-15 CXX=clang++-15 unit_tests
- os: ubuntu-24.04
build:
name: "Debug Build & Unit Tests (clang-18)"
cmd_deps: sudo apt-get install -y -qq clang-18 clang-tools-18 && sudo sysctl -w vm.mmap_rnd_bits=28
cmd_action: CC=clang-18 CXX=clang++-18 unit_tests
# LWIP Build for specific Ubuntu version
- os: ubuntu-24.04
build:
name: "Debug Build & Unit Tests with lwip (gcc)"
cmd_deps: |
sudo apt-get install -y -qq build-essential cmake gcc git iproute2 libpcap-dev
cd ${HOME}
git clone https://github.com/lwip-tcpip/lwip.git
cd ${HOME}/lwip
git checkout tags/STABLE-2_2_1_RELEASE
# Apply the modification to lwipopts.h
sed -i '30a\
#define MEMP_NUM_TCP_PCB 128\n\
#define MEMP_NUM_UDP_PCB 128\n\
#define MEMP_NUM_REASSDATA 128\n\
#define MEMP_NUM_TCP_PCB_LISTEN 128\n\
#define MEMP_NUM_TCP_SEG 128\n\
#define MEMP_NUM_PBUF 128\n\
#define MEMP_NUM_RAW_PCB 128\n\
#define MEMP_NUM_SELECT_CB 128\n\
#define MEMP_NUM_NETBUF 128\n\
#define MEMP_NUM_NETCONN 128\n\
#define PBUF_POOL_SIZE 128\n\
#define MEM_SIZE 64000\n\
#define LWIP_SOCKET 1\n\
#define LWIP_DNS 0' ${HOME}/lwip/contrib/ports/unix/posixlib/lwipopts.h
cd ${HOME}/lwip/contrib/ports/unix/posixlib
mkdir build
cd ${HOME}/lwip/contrib/ports/unix/posixlib/build
cmake ..
make -j$(nproc)
sudo make install
cd ${HOME}
sudo ip tuntap add dev tap0 mode tap
sudo ip link set dev tap0 up
sudo ip addr add 192.168.0.1/24 dev tap0
sudo sysctl -w net.ipv4.ip_forward=1
export PRECONFIGURED_TAPIF=tap0
echo 'export PRECONFIGURED_TAPIF=tap0' >> ~/.bashrc
cmd_action: unit_tests_lwip
# TPM Tool Builds for specific Ubuntu versions
- os: ubuntu-20.04
build:
name: "TPM Tool Build ubuntu-20.04"
cmd_deps: |
sudo apt-get install -y -qq acl autoconf autoconf-archive automake build-essential cmake doxygen gcc git iproute2 libcurl4-openssl-dev libjson-c-dev libcmocka0 libcmocka-dev libgcrypt20-dev libglib2.0-dev libini-config-dev libmbedtls-dev libssl-dev libsqlite3-dev libtool libyaml-dev pkg-config procps python3-pip sqlite3 udev uthash-dev
cd ${HOME}
git clone https://github.com/tpm2-software/tpm2-tss.git
cd ${HOME}/tpm2-tss
git checkout 3.2.3
./bootstrap && ./configure --with-udevrulesdir=/etc/udev/rules.d --with-udevrulesprefix=70-
make -j$(nproc)
sudo make install
sudo ldconfig
sudo udevadm control --reload-rules && sudo udevadm trigger
sudo apt-get install -y -qq tpm2-tools opensc
cd ${HOME}
git clone https://github.com/tpm2-software/tpm2-pkcs11.git
cd ${HOME}/tpm2-pkcs11
git checkout 1.7.0
./bootstrap && ./configure
make -j$(nproc)
sudo make install
sudo ldconfig
sudo cp ${HOME}/tpm2-pkcs11/src/pkcs11.h /usr/include
cd ${HOME}/tpm2-pkcs11/tools/
sudo pip3 install pyasn1_modules
pip3 install .
cmd_action: build_tpm_tool
- os: ubuntu-22.04
build:
name: "TPM Tool Build ubuntu-22.04"
cmd_deps: |
sudo apt-get install -y -qq acl autoconf autoconf-archive automake build-essential cmake doxygen gcc git iproute2 libcurl4-openssl-dev libjson-c-dev libcmocka0 libcmocka-dev libgcrypt20-dev libglib2.0-dev libini-config-dev libmbedtls-dev libssl-dev libsqlite3-dev libtool libyaml-dev pkg-config procps python3-pip sqlite3 udev uthash-dev
cd ${HOME}
git clone https://github.com/tpm2-software/tpm2-tss.git
cd ${HOME}/tpm2-tss
git checkout 3.2.3
./bootstrap && ./configure --with-udevrulesdir=/etc/udev/rules.d --with-udevrulesprefix=70-
make -j$(nproc)
sudo make install
sudo ldconfig
sudo udevadm control --reload-rules && sudo udevadm trigger
sudo apt-get install -y -qq tpm2-tools opensc
cd ${HOME}
git clone https://github.com/tpm2-software/tpm2-pkcs11.git
cd ${HOME}/tpm2-pkcs11
git checkout 1.7.0
./bootstrap && ./configure
make -j$(nproc)
sudo make install
sudo ldconfig
sudo cp ${HOME}/tpm2-pkcs11/src/pkcs11.h /usr/include
cd ${HOME}/tpm2-pkcs11/tools/
sudo pip3 install pyasn1_modules
pip3 install .
cmd_action: build_tpm_tool
- os: ubuntu-24.04
build:
name: "TPM Tool Build ubuntu-24.04"
cmd_deps: |
sudo apt-get install -y -qq acl autoconf autoconf-archive automake build-essential cmake doxygen gcc git iproute2 libcurl4-openssl-dev libjson-c-dev libcmocka0 libcmocka-dev libgcrypt20-dev libglib2.0-dev libini-config-dev libmbedtls-dev libssl-dev libsqlite3-dev libtool libyaml-dev pkg-config procps python3-pip sqlite3 udev uthash-dev libltdl-dev python3-pyasn1-modules
cd ${HOME}
git clone https://github.com/tpm2-software/tpm2-tss.git
cd ${HOME}/tpm2-tss
git checkout 4.1.3
./bootstrap && ./configure --with-udevrulesdir=/etc/udev/rules.d --with-udevrulesprefix=70-
make -j$(nproc)
sudo make install
sudo ldconfig
sudo udevadm control --reload-rules && sudo udevadm trigger
sudo apt-get install -y -qq tpm2-tools python3-tpm2-pytss opensc
cd ${HOME}
git clone https://github.com/tpm2-software/tpm2-pkcs11.git
cd ${HOME}/tpm2-pkcs11
git checkout 1.9.1
./bootstrap && ./configure
make -j$(nproc)
sudo make install
sudo ldconfig
sudo cp ${HOME}/tpm2-pkcs11/src/pkcs11.h /usr/include
cd ${HOME}/tpm2-pkcs11/tools/
pip3 install --break-system-packages .
cmd_action: build_tpm_tool
# Run examples for specific Ubuntu versions
- os: ubuntu-24.04
build:
name: "Examples with MbedTLS and mDNSD (gcc)"
cmd_deps: sudo apt-get install -y -qq libmbedtls-dev python3-netifaces
cmd_action: run_examples MBEDTLS MDNSD
# Valgrind tests for specific Ubuntu versions
- os: ubuntu-24.04
build:
name: "Valgrind Build & Unit Tests with MbedTLS (gcc)"
cmd_deps: sudo apt-get install -y -qq valgrind libmbedtls-dev
cmd_action: unit_tests_valgrind MBEDTLS
- os: ubuntu-24.04
build:
name: "Valgrind Build & Unit Tests with OpenSSL (gcc)"
cmd_deps: sudo apt-get install -y -qq valgrind openssl
cmd_action: unit_tests_valgrind OPENSSL
- os: ubuntu-24.04
build:
name: "Valgrind Examples with MbedTLS and mDNSD (gcc)"
cmd_deps: sudo apt-get install -y -qq valgrind libmbedtls-dev python3-netifaces
cmd_action: examples_valgrind MBEDTLS MDNSD
- os: ubuntu-24.04
build:
name: "Valgrind Examples with OpenSSL and avahi-mdns(gcc)"
cmd_deps: sudo apt-get install -y -qq valgrind openssl libmbedtls-dev python3-netifaces libavahi-client-dev libavahi-common-dev
cmd_action: examples_valgrind OPENSSL AVAHI
# Clang Static Analyzer Builds
- os: ubuntu-20.04
build:
name: "Clang Static Analyzer (clang11)"
cmd_deps: sudo apt-get install -y -qq clang-11 clang-tools-11 libmbedtls-dev
cmd_action: CC=clang-11 CXX=clang++-11 build_clang_analyzer 11
- os: ubuntu-22.04
build:
name: "Clang Static Analyzer (clang15)"
cmd_deps: sudo apt-get install -y -qq clang-15 clang-tools-15 libmbedtls-dev
cmd_action: CC=clang-15 CXX=clang++-15 build_clang_analyzer 15
- os: ubuntu-24.04
build:
name: "Clang Static Analyzer (clang18)"
cmd_deps: sudo apt-get install -y -qq clang-18 clang-tools-18 libmbedtls-dev
cmd_action: CC=clang-18 CXX=clang++-18 build_clang_analyzer 18
name: ${{ matrix.os }}-${{ matrix.build.name }}
runs-on: ubuntu-latest
# runs-on: self-hosted
container:
image: ghcr.io/marwinglaser/ci:${{ matrix.os }}
options: --privileged
services:
mosquitto:
image: eclipse-mosquitto:1.6-openssl
env:
OPEN62541_TEST_MQTT_BROKER: opc.mqtt://mosquitto:1883
steps:
- name: Work around disabled ipv6 on actions container networks
run: |
IPV6="$(cat /proc/sys/net/ipv6/conf/eth0/disable_ipv6)"
echo "Current IPv6 status on eth0: $IPV6"
[ "$IPV6" = "1" ] || exit
echo 0 | sudo tee /proc/sys/net/ipv6/conf/eth0/disable_ipv6 > /dev/null
IPV6="$(cat /proc/sys/net/ipv6/conf/eth0/disable_ipv6)"
echo "New IPv6 status on eth0: $IPV6"
[ "$IPV6" = "0" ] || { echo "Failed to enable IPv6 on eth0"; exit 1; }
- uses: actions/checkout@v6
with:
submodules: true
- name: Install Dependencies
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq build-essential cmake curl libcap2-bin pkg-config libssl-dev python3-sphinx graphviz check libxml2-dev libpcap-dev libreadline-dev
${{ matrix.build.cmd_deps }}
- name: ${{ matrix.build.name }}
shell: bash
run: source tools/ci/linux/ci.sh && ${{ matrix.build.cmd_action }}
env:
ETHERNET_INTERFACE: eth0
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}