-
Notifications
You must be signed in to change notification settings - Fork 424
246 lines (237 loc) · 7.91 KB
/
main.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
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
name: Build Tests
on:
push:
branches:
- main
- develop
- release-*
- gh-workflows
pull_request:
branches:
- main
- develop
env:
PLATFORM: posix
TESTS: yes
OPENSSL_INSTALL_PATH: C:\Program Files\OpenSSL\
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
CC: ["gcc", "clang"]
TLS: ["no", "openssl", "gnutls", "mbedtls"]
steps:
- uses: actions/checkout@v3
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev libtool libtool-bin exuberant-ctags valgrind
./autogen.sh
- name: configure no-TLS
if: matrix.TLS == 'no'
run: |
mkdir build-${{matrix.TLS}}-${{matrix.CC}}
cd build-${{matrix.TLS}}-${{matrix.CC}}
$GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --disable-dtls CC=${{matrix.CC}}
- name: configure TLS
if: matrix.TLS != 'no'
run: |
mkdir build-${{matrix.TLS}}-${{matrix.CC}}
cd build-${{matrix.TLS}}-${{matrix.CC}}
"$GITHUB_WORKSPACE/configure" --disable-silent-rules --disable-documentation --enable-examples --enable-tests --with-${{matrix.TLS}} CC=${{matrix.CC}}
- name: compile
run: |
cd build-${{matrix.TLS}}-${{matrix.CC}}
make EXTRA_CFLAGS=-Werror && make check EXTRA_CFLAGS=-Werror
- name: test
run: |
cd build-${{matrix.TLS}}-${{matrix.CC}}
libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=$GITHUB_WORKSPACE/tests/valgrind_suppression tests/testdriver
tinydtls-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libtool libtool-bin exuberant-ctags valgrind
./autogen.sh
- name: configure
run: |
$GITHUB_WORKSPACE/configure --disable-silent-rules --disable-documentation --enable-examples --enable-tests --with-tinydtls
- name: compile
run: |
make EXTRA_CFLAGS=-Werror && make check EXTRA_CFLAGS=-Werror
- name: test
run: |
LD_LIBRARY_PATH=ext/tinydtls libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet --suppressions=$GITHUB_WORKSPACE/tests/valgrind_suppression tests/testdriver
cmake-build:
runs-on: ubuntu-latest
strategy:
matrix:
TLS: ["no", "openssl", "gnutls", "mbedtls", "tinydtls"]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libmbedtls-dev libgnutls28-dev
cmake -E make_directory $GITHUB_WORKSPACE/build-${{matrix.TLS}}-cmake
- name: configure no-TLS
if: matrix.TLS == 'no'
run: |
cd $GITHUB_WORKSPACE/build-${{matrix.TLS}}-cmake
cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DENABLE_DTLS=OFF -DENABLE_DOCS=OFF -DWARNING_TO_ERROR=ON
- name: configure TLS
if: matrix.TLS != 'no'
run: |
cd $GITHUB_WORKSPACE/build-${{matrix.TLS}}-cmake
cmake $GITHUB_WORKSPACE -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON -DENABLE_DTLS=ON -DENABLE_DOCS=OFF -DDTLS_BACKEND=${{matrix.TLS}} -DWARNING_TO_ERROR=ON
- name: build
run: |
cd $GITHUB_WORKSPACE/build-${{matrix.TLS}}-cmake
cmake --build .
cmake-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: macOS CMake setup
run: |
cmake -E make_directory build_test
- name: macOS CMake configure
run: |
cd build_test
cmake .. -DWARNING_TO_ERROR=ON -DENABLE_TESTS=NO -DENABLE_DTLS=NO
- name: macOS CMake build
run: |
cd build_test
cmake --build .
other-build:
runs-on: ubuntu-latest
strategy:
matrix:
OS: ["contiki", "lwip", "riot"]
steps:
- uses: actions/checkout@v3
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libc6-dev-i386
./autogen.sh
- name: configure
run: |
$GITHUB_WORKSPACE/configure --disable-documentation --disable-examples --disable-tests --disable-dtls
- name: compile
run: |
make -C examples/${{matrix.OS}} EXTRA_CFLAGS=-Werror
ms-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Build sln
shell: cmd
run: call .\scripts\msbuild.sln.cmd
ms-cmake:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: MS CMake setup
run: |
cmake -E make_directory build_test
- name: MS CMake configure
run: |
cd build_test
cmake .. -DWARNING_TO_ERROR=ON -DWITH_OPENSSL=YES
- name: MS CMake build
run: |
cd build_test
cmake --build .
mingw-cmake:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: git mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-openssl
- name: MinGW build
run: |
echo 'Running in MSYS2!'
scripts/mingw-cmake.sh
additional-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libgnutls28-dev libtool libtool-bin exuberant-ctags
./autogen.sh
- name: configure
run: ./configure --disable-tests --disable-documentation
- name: build
run: |
make
make -C tests/oss-fuzz -f Makefile.ci check clean
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libtool libtool-bin exuberant-ctags graphviz doxygen libxml2-utils xsltproc docbook-xml docbook-xsl asciidoc
./autogen.sh
- name: configure
run: ./configure --disable-tests --enable-documentation --prefix $GITHUB_WORKSPACE/test-install
- name: manuals check
run: |
make -C man
- name: manual page examples check
run: |
man/examples-code-check man
- name: doxygen check
run: |
make -C doc
- name: installation check
run: |
make install && ls -lR $GITHUB_WORKSPACE/test-install
distribution:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup
run: |
sudo apt-get update && sudo apt-get install -y libcunit1-dev libtool libtool-bin exuberant-ctags graphviz doxygen libxml2-utils xsltproc docbook-xml docbook-xsl asciidoc libc6-dev-i386
./autogen.sh
- name: configure
run: |
mkdir build-dist
cd build-dist
$GITHUB_WORKSPACE/configure --enable-silent-rules --enable-documentation --enable-examples --disable-dtls
- name: build distribution
run: |
cd build-dist
make dist
- name: check distribution build
run: |
cd build-dist
$GITHUB_WORKSPACE/scripts/github_dist.sh
shell: bash
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]