-
Notifications
You must be signed in to change notification settings - Fork 3.4k
117 lines (113 loc) · 4 KB
/
Copy pathtest-ssllib.yml
File metadata and controls
117 lines (113 loc) · 4 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
name: test_ssllib
on:
workflow_call:
inputs:
libname:
required: true
type: string
ovpnlibname:
type: string
default: openssl
ovpnlibdesc:
required: true
type: string
ghrepo:
required: true
type: string
gitref:
required: true
type: string
libconfigure:
required: true
type: string
libmake:
type: string
default: "make -j3"
libinstall:
type: string
default: "sudo make install"
ovpnconfigureenv:
type: string
default: >-
OPENSSL_CFLAGS="-I$LIBPREFIX/include"
OPENSSL_LIBS="-L$LIBPREFIX/lib -lssl -lcrypto"
LDFLAGS="-Wl,-rpath=$LIBPREFIX/lib"
ovpnconfigureflags:
type: string
default: --enable-werror --with-openssl-engine=no
jobs:
test_ssllib:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
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
cxx: clang++
- build: normal
cflags: "-O2 -g"
ldflags: ""
cc: gcc
cxx: g++
name: "${{matrix.cc}} ${{matrix.build}} - ${{matrix.os}} - ${{inputs.libname}}"
runs-on: ${{matrix.os}}
env:
CFLAGS: ${{matrix.cflags}}
LDFLAGS: ${{matrix.ldflags}}
CC: ${{matrix.cc}}
CXX: ${{matrix.cxx}}
UBSAN_OPTIONS: print_stacktrace=1
LIBPREFIX: /opt/${{inputs.libname}}
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: Restore ${{inputs.libname}} from cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
id: ssllib-cache
with:
path: ${{env.LIBPREFIX}}
key: ${{matrix.os}}-${{inputs.libname}}-${{matrix.build }}-${{inputs.gitref}}
- name: "${{inputs.libname}}: checkout"
if: steps.ssllib-cache.outputs.cache-hit != 'true'
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
submodules: recursive
path: ${{inputs.libname}}
repository: ${{inputs.ghrepo}}
ref: ${{inputs.gitref}}
- name: "${{inputs.libname}}: configure"
if: steps.ssllib-cache.outputs.cache-hit != 'true'
run: ${{inputs.libconfigure}}
working-directory: ${{inputs.libname}}
- name: "${{inputs.libname}}: build"
if: steps.ssllib-cache.outputs.cache-hit != 'true'
run: ${{inputs.libmake}}
working-directory: ${{inputs.libname}}
- name: "${{inputs.libname}}: install"
if: steps.ssllib-cache.outputs.cache-hit != 'true'
run: ${{inputs.libinstall}}
working-directory: ${{inputs.libname}}
- name: Run ldconfig
run: sudo ldconfig
- name: "OpenVPN: checkout"
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: "OpenVPN: autoreconf"
run: autoreconf -fvi
- name: "OpenVPN: configure"
run: |
${{inputs.ovpnconfigureenv}} \
./configure --with-crypto-library=${{inputs.ovpnlibname}} ${{inputs.ovpnconfigureflags}}
- name: "OpenVPN: build"
run: make -j3
- name: Ensure the build uses ${{inputs.libname}}
run: |
./src/openvpn/openvpn --version
./src/openvpn/openvpn --version | grep -q "library versions: ${{inputs.ovpnlibdesc}}"
- name: "OpenVPN: configure checks"
run: echo 'RUN_SUDO="sudo -E"' >tests/t_server_null.rc
- name: "OpenVPN: make check"
run: make -j3 check VERBOSE=1