Skip to content

Commit a941c92

Browse files
committed
CI: github: add a WolfSSL job which tries the latest version
Like the AWS-LC job, add a CI job which looks for the latest WolfSSL version and tries to build it. The patch adds a function which determines the latest version of WolfSSL from the github tag, and the yml which describes the job.
1 parent 16e44e7 commit a941c92

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

.github/matrix.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,21 @@ def determine_latest_aws_lc(ssl):
6767
latest_tag = max(valid_tags, key=aws_lc_version_string_to_num)
6868
return "AWS_LC_VERSION={}".format(latest_tag[1:])
6969

70+
def wolfssl_version_string_to_num(version_string):
71+
return tuple(map(int, version_string[1:].removesuffix('-stable').split('.')))
72+
73+
def wolfssl_version_valid(version_string):
74+
return re.match('^v[0-9]+(\.[0-9]+)*-stable$', version_string)
75+
76+
@functools.lru_cache(5)
77+
def determine_latest_wolfssl(ssl):
78+
tags = get_all_github_tags("https://api.github.com/repos/wolfssl/wolfssl/tags")
79+
if not tags:
80+
return "WOLFSSL_VERSION=failed_to_detect"
81+
valid_tags = list(filter(wolfssl_version_valid, tags))
82+
latest_tag = max(valid_tags, key=wolfssl_version_string_to_num)
83+
return "WOLFSSL_VERSION={}".format(latest_tag[1:].removesuffix('-stable'))
84+
7085
@functools.lru_cache(5)
7186
def determine_latest_libressl(ssl):
7287
try:

.github/workflows/wolfssl.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: WolfSSL
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * 4"
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Install VTest
17+
run: |
18+
scripts/build-vtest.sh
19+
- name: Determine latest WolfSSL release
20+
id: get_wolfssl_release
21+
run: |
22+
result=$(cd .github && python3 -c "from matrix import determine_latest_wolfssl; print(determine_latest_wolfssl(''))")
23+
echo $result
24+
echo "result=$result" >> $GITHUB_OUTPUT
25+
- name: Cache WolfSSL
26+
id: cache_wolfssl
27+
uses: actions/cache@v4
28+
with:
29+
path: '~/opt/'
30+
key: ssl-${{ steps.get_wolfssl_release.outputs.result }}-Ubuntu-latest-gcc
31+
- name: Install WolfSSL
32+
if: ${{ steps.cache_ssl.outputs.cache-hit != 'true' }}
33+
run: env ${{ steps.get_wolfssl_release.outputs.result }} scripts/build-ssl.sh
34+
- name: Compile HAProxy
35+
run: |
36+
make -j$(nproc) ERR=1 CC=gcc TARGET=linux-glibc \
37+
USE_OPENSSL_WOLFSSL=1 USE_QUIC=1 \
38+
SSL_LIB=${HOME}/opt/lib SSL_INC=${HOME}/opt/include \
39+
DEBUG="-DDEBUG_POOL_INTEGRITY" \
40+
ADDLIB="-Wl,-rpath,/usr/local/lib/ -Wl,-rpath,$HOME/opt/lib/"
41+
sudo make install
42+
- name: Show HAProxy version
43+
id: show-version
44+
run: |
45+
ldd $(which haproxy)
46+
haproxy -vv
47+
echo "version=$(haproxy -v |awk 'NR==1{print $3}')" >> $GITHUB_OUTPUT
48+
- name: Install problem matcher for VTest
49+
run: echo "::add-matcher::.github/vtest.json"
50+
- name: Run VTest for HAProxy
51+
id: vtest
52+
run: |
53+
# This is required for macOS which does not actually allow to increase
54+
# the '-n' soft limit to the hard limit, thus failing to run.
55+
ulimit -n 65536
56+
make reg-tests VTEST_PROGRAM=../vtest/vtest REGTESTS_TYPES=default,bug,devel
57+
- name: Show VTest results
58+
if: ${{ failure() && steps.vtest.outcome == 'failure' }}
59+
run: |
60+
for folder in ${TMPDIR}/haregtests-*/vtc.*; do
61+
printf "::group::"
62+
cat $folder/INFO
63+
cat $folder/LOG
64+
echo "::endgroup::"
65+
done
66+
exit 1

0 commit comments

Comments
 (0)