-
Notifications
You must be signed in to change notification settings - Fork 3k
424 lines (391 loc) · 15.6 KB
/
build.yaml
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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# The name of our workflow
name: Build
on:
push:
pull_request:
jobs:
checkuncrustify:
name: "Check code style with Uncrustify"
# Ubuntu 22.04 has uncrustify 0.72_f
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y uncrustify
- name: Checkout OpenVPN
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
path: openvpn
- name: Show uncrustify version
run: uncrustify --version
- name: Run uncrustify
run: ./dev-tools/reformat-all.sh
working-directory: openvpn
- name: Check for changes
run: git diff --output=uncrustify-changes.patch
working-directory: openvpn
- name: Show changes on standard output
run: git diff
working-directory: openvpn
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
with:
name: uncrustify-changes.patch
path: 'openvpn/uncrustify-changes.patch'
- name: Set job status
run: test ! -s uncrustify-changes.patch
working-directory: openvpn
mingw:
strategy:
fail-fast: false
matrix:
arch: [x86, x64]
name: "gcc-mingw - ${{ matrix.arch }} - OSSL"
runs-on: ubuntu-22.04
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y mingw-w64 unzip cmake ninja-build build-essential wget python3-docutils man2html-base
- name: Checkout OpenVPN
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Restore from cache and install vcpkg
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: 9f5925e81bbcd9c8c34cc7a8bd25e3c557b582b2
vcpkgJsonGlob: '**/mingw/vcpkg.json'
- name: Run CMake with vcpkg.json manifest
uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8
with:
configurePreset: mingw-${{ matrix.arch }}
buildPreset: mingw-${{ matrix.arch }}
buildPresetAdditionalArgs: "['--config Debug']"
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
with:
name: openvpn-mingw-${{ matrix.arch }}
path: |
${{ github.workspace }}/out/build/mingw/${{ matrix.arch }}/Debug/*.exe
${{ github.workspace }}/out/build/mingw/${{ matrix.arch }}/Debug/*.dll
!${{ github.workspace }}/out/build/mingw/${{ matrix.arch }}/Debug/test_*.exe
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
with:
name: openvpn-mingw-${{ matrix.arch }}-tests
path: |
${{ github.workspace }}/out/build/mingw/${{ matrix.arch }}/Debug/test_*.exe
${{ github.workspace }}/out/build/mingw/${{ matrix.arch }}/Debug/*.dll
mingw-unittest:
needs: [ mingw ]
strategy:
fail-fast: false
matrix:
arch: [x86, x64]
test: [argv, auth_token, buffer, cryptoapi, crypto, misc, ncp, packet_id, pkt, provider, ssl, tls_crypt, user_pass]
runs-on: windows-latest
name: "mingw unittest ${{ matrix.test }} - ${{ matrix.arch }} - OSSL"
steps:
- name: Checkout OpenVPN
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Retrieve mingw unittest
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
name: openvpn-mingw-${{ matrix.arch }}-tests
path: unittests
- name: Run ${{ matrix.test }} unit test
run: ./unittests/test_${{ matrix.test }}.exe
env:
srcdir: "${{ github.workspace }}/tests/unit_tests/openvpn"
ubuntu:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
sslpkg: [libmbedtls-dev]
ssllib: [mbedtls]
libname: [mbed TLS]
include:
- os: ubuntu-20.04
sslpkg: "libssl-dev"
libname: OpenSSL 1.1.1
ssllib: openssl
- os: ubuntu-22.04
sslpkg: "libssl-dev"
libname: OpenSSL 3.0.2
ssllib: openssl
pkcs11pkg: "libpkcs11-helper1-dev softhsm2 gnutls-bin"
extraconf: --enable-pkcs11
- os: ubuntu-24.04
sslpkg: "libssl-dev"
libname: OpenSSL 3.0.13
ssllib: openssl
pkcs11pkg: "libpkcs11-helper1-dev softhsm2 gnutls-bin"
extraconf: --enable-pkcs11
- os: ubuntu-20.04
sslpkg: "libssl-dev"
libname: OpenSSL 1.1.1
ssllib: openssl
pkcs11pkg: "libpkcs11-helper1-dev softhsm2 gnutls-bin"
extraconf: "--enable-iproute2 --enable-pkcs11"
- os: ubuntu-20.04
sslpkg: "libssl-dev"
libname: OpenSSL 1.1.1
ssllib: openssl
extraconf: "--enable-async-push"
- os: ubuntu-20.04
sslpkg: "libssl-dev"
libname: OpenSSL 1.1.1
ssllib: openssl
extraconf: "--disable-management"
- os: ubuntu-20.04
sslpkg: "libssl-dev"
libname: OpenSSL 1.1.1
ssllib: openssl
extraconf: "--enable-small"
- os: ubuntu-20.04
sslpkg: "libssl-dev"
libname: OpenSSL 1.1.1
ssllib: openssl
extraconf: "--disable-lzo --disable-lz4"
name: "gcc - ${{matrix.os}} - ${{matrix.libname}} ${{matrix.extraconf}}"
env:
SSLPKG: "${{matrix.sslpkg}}"
PKCS11PKG: "${{matrix.pkcs11pkg}}"
runs-on: ${{matrix.os}}
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev libnl-genl-3-dev linux-libc-dev man2html libcmocka-dev python3-docutils libtool automake autoconf ${SSLPKG} ${PKCS11PKG}
- name: Checkout OpenVPN
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: autoconf
run: autoreconf -fvi
- name: configure
run: ./configure --with-crypto-library=${{matrix.ssllib}} ${{matrix.extraconf}} --enable-werror
- name: make all
run: make -j3
- name: configure checks
if: ${{ matrix.extraconf != '--disable-management' }}
run: echo 'RUN_SUDO="sudo -E"' >tests/t_server_null.rc
- name: make check
run: make -j3 check VERBOSE=1
ubuntu-clang-asan:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
ssllib: [mbedtls, openssl]
name: "clang-asan - ${{matrix.os}} - ${{matrix.ssllib}}"
env:
UBSAN_OPTIONS: print_stacktrace=1
runs-on: ${{matrix.os}}
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev libcap-ng-dev libnl-genl-3-dev linux-libc-dev man2html clang libcmocka-dev python3-docutils libtool automake autoconf libmbedtls-dev
- name: Checkout OpenVPN
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: autoconf
run: autoreconf -fvi
- name: configure
run: CFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer -O2" CC=clang ./configure --with-crypto-library=${{matrix.ssllib}} --enable-werror
- name: make all
run: make -j3
- name: configure checks
run: echo 'RUN_SUDO="sudo -E"' >tests/t_server_null.rc
- name: make check
run: make -j3 check VERBOSE=1
macos:
strategy:
fail-fast: false
matrix:
ssllib: [[email protected], openssl@3, libressl]
build: [normal, asan]
os: [macos-13, macos-14, macos-15]
include:
- build: asan
cflags: "-fsanitize=address,undefined -fno-sanitize-recover=all -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1"
ldflags: -fsanitize=address,undefined -fno-sanitize-recover=all
# Our build system ignores LDFLAGS for plugins
configureflags: --disable-plugin-auth-pam --disable-plugin-down-root
- build: normal
cflags: "-O2 -g"
ldflags: ""
configureflags: ""
runs-on: ${{matrix.os}}
name: "${{matrix.os}} - ${{matrix.ssllib}} - ${{matrix.build}}"
env:
CFLAGS: ${{ matrix.cflags }}
LDFLAGS: ${{ matrix.ldflags }}
UBSAN_OPTIONS: print_stacktrace=1
steps:
- name: Install dependencies
run: brew install ${{matrix.ssllib}} lzo lz4 man2html cmocka libtool automake autoconf
- name: Checkout OpenVPN
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set environment
run: |
cat >>$GITHUB_ENV <<EOF;
OPENSSL_CFLAGS=-I$(brew --prefix ${{matrix.ssllib}})/include
OPENSSL_LIBS=-L$(brew --prefix ${{matrix.ssllib}})/lib -lcrypto -lssl
LZO_CFLAGS=-I$(brew --prefix lzo)/include
LZO_LIBS=-L$(brew --prefix lzo)/lib -llzo2
EOF
- name: autoconf
run: autoreconf -fvi
- name: configure
run: ./configure --enable-werror ${{matrix.configureflags}}
- name: make all
run: make -j4
- name: configure checks
run: echo 'RUN_SUDO="sudo -E"' >tests/t_server_null.rc
- name: make check
run: make -j4 check VERBOSE=1
msvc:
strategy:
fail-fast: false
matrix:
arch: [amd64, x86, arm64]
name: "msbuild - ${{ matrix.arch }} - openssl"
env:
BUILD_CONFIGURATION: Release
runs-on: windows-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: lukka/get-cmake@070a0507a7abe157ef918deec391da1be197d2d1 # v3.30.3
- name: Install rst2html
run: python -m pip install --upgrade pip docutils
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: 9f5925e81bbcd9c8c34cc7a8bd25e3c557b582b2
vcpkgJsonGlob: '**/windows/vcpkg.json'
- name: Run CMake with vcpkg.json manifest (NO TESTS)
uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8
if: ${{ matrix.arch == 'arm64' }}
with:
configurePreset: win-${{ matrix.arch }}-release
buildPreset: win-${{ matrix.arch }}-release
- name: Run CMake with vcpkg.json manifest
uses: lukka/run-cmake@af1be47fd7c933593f687731bc6fdbee024d3ff4 # v10.8
if: ${{ matrix.arch != 'arm64' }}
with:
configurePreset: win-${{ matrix.arch }}-release
buildPreset: win-${{ matrix.arch }}-release
testPreset: win-${{ matrix.arch }}-release
testPresetAdditionalArgs: "['--output-on-failure']"
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
with:
name: openvpn-msvc-${{ matrix.arch }}
path: |
${{ github.workspace }}/out/**/*.exe
${{ github.workspace }}/out/**/*.dll
!${{ github.workspace }}/out/**/test_*.exe
!${{ github.workspace }}/out/**/CMakeFiles/**
!${{ github.workspace }}/out/**/vcpkg_installed/**
libressl:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
ssllib: [libressl]
build: [ normal, asan ]
configureflags: ["--with-openssl-engine=no"]
include:
- build: asan
cflags: "-fsanitize=address -fno-sanitize-recover=all -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1"
ldflags: -fsanitize=address -fno-sanitize-recover=all
cc: clang
- build: normal
cflags: "-O2 -g"
ldflags: ""
cc: gcc
name: "${{matrix.cc}} ${{matrix.build}} - ${{matrix.os}} - ${{matrix.ssllib}}"
runs-on: ${{matrix.os}}
env:
CFLAGS: ${{ matrix.cflags }}
LDFLAGS: ${{ matrix.ldflags }}
CC: ${{matrix.cc}}
UBSAN_OPTIONS: print_stacktrace=1
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev linux-libc-dev man2html clang libcmocka-dev python3-docutils libtool automake autoconf pkg-config libcap-ng-dev libnl-genl-3-dev
- name: "libressl: checkout"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
path: libressl
# versioning=semver-coerced
repository: libressl/portable
ref: v3.8.3
- name: "libressl: autogen.sh"
run: ./autogen.sh
working-directory: libressl
- name: "libressl: configure"
run: ./configure
working-directory: libressl
- name: "libressl: make all"
run: make -j3
working-directory: libressl
- name: "libressl: make install"
run: sudo make install
working-directory: libressl
- name: "ldconfig"
run: sudo ldconfig
- name: Checkout OpenVPN
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: autoconf
run: autoreconf -fvi
- name: configure
run: ./configure --with-crypto-library=openssl ${{matrix.configureflags}} --enable-werror
- name: make all
run: make -j3
- name: configure checks
run: echo 'RUN_SUDO="sudo -E"' >tests/t_server_null.rc
- name: make check
run: make -j3 check VERBOSE=1
mbedtls3:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
ssllib: [mbedtls3]
build: [ normal, asan ]
include:
- build: asan
cflags: "-fsanitize=address -fno-sanitize-recover=all -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1"
ldflags: -fsanitize=address -fno-sanitize-recover=all
cc: clang
- build: normal
cflags: "-O2 -g"
ldflags: ""
cc: gcc
name: "${{matrix.cc}} ${{matrix.build}} - ${{matrix.os}} - ${{matrix.ssllib}}"
runs-on: ${{matrix.os}}
env:
CFLAGS: ${{ matrix.cflags }}
LDFLAGS: ${{ matrix.ldflags }}
CC: ${{matrix.cc}}
UBSAN_OPTIONS: print_stacktrace=1
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y liblzo2-dev libpam0g-dev liblz4-dev linux-libc-dev man2html clang libcmocka-dev python3-docutils python3-jinja2 python3-jsonschema libtool automake autoconf pkg-config libcap-ng-dev libnl-genl-3-dev
- name: "mbedtls: checkout"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
path: mbedtls
submodules: true
# versioning=semver-coerced
repository: Mbed-TLS/mbedtls
ref: v3.6.1
- name: "mbedtls: make no_test"
run: make -j3 no_test SHARED=1
working-directory: mbedtls
- name: "mbedtls: make install"
run: sudo make install DESTDIR=/usr
working-directory: mbedtls
- name: Checkout OpenVPN
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: autoconf
run: autoreconf -fvi
- name: configure
run: ./configure --with-crypto-library=mbedtls
- name: make all
run: make -j3
- name: configure checks
run: echo 'RUN_SUDO="sudo -E"' >tests/t_server_null.rc
- name: make check
run: make -j3 check VERBOSE=1