Skip to content

Commit b41d577

Browse files
committed
Merge branch 'master' into feature/integrate_openssl_comp_fixes
# Conflicts: # tests/api/test_tls.h
2 parents af8061a + a50a540 commit b41d577

File tree

106 files changed

+3159
-800
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+3159
-800
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: 'Install apt dependencies'
2+
description: 'Install apt packages with retry logic and caching'
3+
inputs:
4+
packages:
5+
description: 'Space-separated list of apt packages to install'
6+
required: true
7+
retries:
8+
description: 'Number of retry attempts'
9+
required: false
10+
default: '3'
11+
retry-delay:
12+
description: 'Initial delay between retries (seconds, doubles each attempt)'
13+
required: false
14+
default: '5'
15+
no-install-recommends:
16+
description: 'Pass --no-install-recommends to apt-get install'
17+
required: false
18+
default: 'false'
19+
cache:
20+
description: 'Cache apt archives (disable for dynamic package names)'
21+
required: false
22+
default: 'true'
23+
runs:
24+
using: 'composite'
25+
steps:
26+
- name: Compute cache key
27+
if: inputs.cache == 'true'
28+
id: cache-key
29+
shell: bash
30+
run: |
31+
SORTED_PKGS=$(echo "${{ inputs.packages }}" | tr ' ' '\n' | sort -u | tr '\n' ' ')
32+
PKG_HASH=$(echo "$SORTED_PKGS" | sha256sum | cut -d' ' -f1 | head -c 16)
33+
OS_VERSION=$(lsb_release -rs 2>/dev/null || echo "unknown")
34+
echo "key=apt-deps-${{ runner.os }}-${{ runner.arch }}-${OS_VERSION}-${PKG_HASH}" >> $GITHUB_OUTPUT
35+
echo "restore-key=apt-deps-${{ runner.os }}-${{ runner.arch }}-${OS_VERSION}-" >> $GITHUB_OUTPUT
36+
37+
- name: Restore apt cache
38+
if: inputs.cache == 'true'
39+
id: apt-cache
40+
uses: actions/cache/restore@v4
41+
with:
42+
path: ~/apt-cache
43+
key: ${{ steps.cache-key.outputs.key }}
44+
restore-keys: ${{ steps.cache-key.outputs.restore-key }}
45+
46+
- name: Pre-seed apt archives from cache
47+
if: inputs.cache == 'true' && steps.apt-cache.outputs.cache-hit == 'true'
48+
shell: bash
49+
run: |
50+
if [ -d ~/apt-cache ] && ls ~/apt-cache/*.deb >/dev/null 2>&1; then
51+
sudo cp ~/apt-cache/*.deb /var/cache/apt/archives/
52+
echo "Restored $(ls ~/apt-cache/*.deb | wc -l) cached .deb files"
53+
fi
54+
55+
- name: Install packages
56+
shell: bash
57+
run: |
58+
export DEBIAN_FRONTEND=noninteractive
59+
RETRIES=${{ inputs.retries }}
60+
DELAY=${{ inputs.retry-delay }}
61+
NO_REC=""
62+
if [ "${{ inputs.no-install-recommends }}" = "true" ]; then
63+
NO_REC="--no-install-recommends"
64+
fi
65+
for i in $(seq 1 $RETRIES); do
66+
if sudo apt-get update -q && \
67+
sudo apt-get install -y $NO_REC ${{ inputs.packages }}; then
68+
exit 0
69+
fi
70+
if [ "$i" -eq "$RETRIES" ]; then
71+
echo "::error::apt-get failed after $RETRIES attempts"
72+
exit 1
73+
fi
74+
echo "::warning::apt-get failed (attempt $i/$RETRIES), retrying in ${DELAY}s..."
75+
sleep $DELAY
76+
DELAY=$((DELAY * 2))
77+
done
78+
79+
- name: Collect .deb files for cache
80+
if: inputs.cache == 'true' && steps.apt-cache.outputs.cache-hit != 'true'
81+
shell: bash
82+
run: |
83+
mkdir -p ~/apt-cache
84+
cp /var/cache/apt/archives/*.deb ~/apt-cache/ 2>/dev/null || true
85+
echo "Cached $(ls ~/apt-cache/*.deb 2>/dev/null | wc -l) .deb files"
86+
87+
- name: Save apt cache
88+
if: inputs.cache == 'true' && steps.apt-cache.outputs.cache-hit != 'true'
89+
uses: actions/cache/save@v4
90+
with:
91+
path: ~/apt-cache
92+
key: ${{ steps.cache-key.outputs.key }}

.github/workflows/ada.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build:
1111

1212
if: github.repository_owner == 'wolfssl'
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-24.04
1414

1515
steps:
1616
- uses: actions/checkout@v4
@@ -56,11 +56,14 @@ jobs:
5656
if: ${{ failure() && steps.examples.outcome == 'failure' }}
5757
run: cat ./wrapper/Ada/examples/server.log
5858

59+
- name: Install valgrind
60+
uses: ./.github/actions/install-apt-deps
61+
with:
62+
packages: valgrind
63+
5964
- name: Run Ada wrapper tests (valgrind)
6065
working-directory: ./wrapper/Ada/tests
6166
run: |
62-
sudo apt-get update
63-
sudo apt-get install -y valgrind
6467
valgrind --leak-check=full --error-exitcode=1 \
6568
--suppressions=valgrind.supp ./bin/tests
6669

.github/workflows/arduino.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ concurrency:
7777
jobs:
7878
build:
7979
if: github.repository_owner == 'wolfssl'
80-
runs-on: ubuntu-latest
80+
runs-on: ubuntu-24.04
8181

8282
strategy:
8383
fail-fast: false

.github/workflows/async-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Build async examples (no configure)
3232
run: |
3333
make -C examples/async clean
34-
make -C examples/async ASYNC_MODE=${{ matrix.async_mode }} EXTRA_CFLAGS="${{ matrix.extra_cflags }}"
34+
make -j -C examples/async ASYNC_MODE=${{ matrix.async_mode }} EXTRA_CFLAGS="${{ matrix.extra_cflags }}"
3535
3636
- name: Run async examples
3737
run: |

.github/workflows/async.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ jobs:
2020
# Add new configs here
2121
'--enable-asynccrypt --enable-all --enable-dtls13 --disable-mlkem CFLAGS="-pedantic -Wdeclaration-after-statement -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT"',
2222
'--enable-asynccrypt-sw --enable-ocspstapling --enable-ocspstapling2 --disable-mlkem CFLAGS="-pedantic -Wdeclaration-after-statement -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE"',
23-
'--enable-asynccrypt --enable-all --enable-dtls13 --disable-pqc-hybrids --enable-tls-mlkem-standalone CFLAGS="-pedantic -Wdeclaration-after-statement -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT"',
24-
'--enable-asynccrypt-sw --enable-ocspstapling --enable-ocspstapling2 --disable-pqc-hybrids --enable-tls-mlkem-standalone CFLAGS="-pedantic -Wdeclaration-after-statement -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE"',
2523
'--enable-asynccrypt --enable-all --enable-dtls13 CFLAGS="-pedantic -Wdeclaration-after-statement -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE -DWOLFCRYPT_TEST_LINT"',
2624
'--enable-asynccrypt-sw --enable-ocspstapling --enable-ocspstapling2 CFLAGS="-pedantic -Wdeclaration-after-statement -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE"',
2725
'--enable-ocsp CFLAGS="-DTEST_NONBLOCK_CERTS -pedantic -Wdeclaration-after-statement -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE"',

.github/workflows/bind.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ jobs:
5252
timeout-minutes: 10
5353
needs: build_wolfssl
5454
steps:
55+
- name: Checkout wolfSSL CI actions
56+
uses: actions/checkout@v4
57+
with:
58+
sparse-checkout: .github/actions
59+
fetch-depth: 1
60+
5561
- name: Download lib
5662
uses: actions/download-artifact@v4
5763
with:
@@ -61,25 +67,24 @@ jobs:
6167
run: tar -xf build-dir.tgz
6268

6369
- name: Install dependencies
64-
run: |
65-
# Don't prompt for anything
66-
export DEBIAN_FRONTEND=noninteractive
67-
sudo apt-get update
68-
# hostap dependencies
69-
sudo apt-get install -y libuv1-dev libnghttp2-dev libcap-dev libcmocka-dev liburcu-dev
70+
uses: ./.github/actions/install-apt-deps
71+
with:
72+
packages: libuv1-dev libnghttp2-dev libcap-dev libcmocka-dev liburcu-dev
7073

7174
- name: Checkout OSP
7275
uses: actions/checkout@v4
7376
with:
7477
repository: wolfssl/osp
7578
path: osp
79+
fetch-depth: 1
7680

7781
- name: Checkout bind9
7882
uses: actions/checkout@v4
7983
with:
8084
repository: isc-projects/bind9
8185
path: bind
8286
ref: v${{ matrix.ref }}
87+
fetch-depth: 1
8388

8489
- name: Build and test bind9
8590
working-directory: bind

.github/workflows/cmake-autoconf.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ on:
99
jobs:
1010
build:
1111
if: github.repository_owner == 'wolfssl'
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313

1414
steps:
1515
# pull wolfSSL
1616
- uses: actions/checkout@v4
1717

18-
# install cmake and autotools
19-
- name: Install cmake
20-
run: |
21-
sudo apt-get update
22-
sudo apt-get install -y cmake autoconf automake libtool
18+
- name: Install cmake and autotools
19+
uses: ./.github/actions/install-apt-deps
20+
with:
21+
packages: cmake autoconf automake libtool
2322

2423
# build and install wolfssl via autotools for CMake consumer test
2524
- name: Build wolfssl with autotools

.github/workflows/cmake.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ on:
99
jobs:
1010
build:
1111
if: github.repository_owner == 'wolfssl'
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-24.04
1313

1414
steps:
1515
# pull wolfSSL
1616
- uses: actions/checkout@v4
1717

18-
# install cmake
1918
- name: Install cmake
20-
run: |
21-
sudo apt-get update
22-
sudo apt-get install -y cmake
19+
uses: ./.github/actions/install-apt-deps
20+
with:
21+
packages: cmake
2322

2423
# build wolfssl
2524
- name: Build wolfssl

.github/workflows/curl.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,16 @@ jobs:
4949
matrix:
5050
curl_ref: [ 'master', 'curl-8_4_0' ]
5151
steps:
52+
- name: Checkout wolfSSL CI actions
53+
uses: actions/checkout@v4
54+
with:
55+
sparse-checkout: .github/actions
56+
fetch-depth: 1
57+
5258
- name: Install test dependencies
53-
run: |
54-
sudo apt-get update
55-
sudo apt-get install nghttp2 libpsl5 libpsl-dev python3-impacket apache2 apache2-dev
59+
uses: ./.github/actions/install-apt-deps
60+
with:
61+
packages: nghttp2 libpsl5 libpsl-dev python3-impacket apache2 apache2-dev
5662

5763
- name: Download lib
5864
uses: actions/download-artifact@v4

.github/workflows/cyrus-sasl.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@ jobs:
5353
timeout-minutes: 4
5454
needs: build_wolfssl
5555
steps:
56+
- name: Checkout wolfSSL CI actions
57+
uses: actions/checkout@v4
58+
with:
59+
sparse-checkout: .github/actions
60+
fetch-depth: 1
61+
5662
- name: Install dependencies
57-
run: |
58-
# Don't prompt for anything
59-
export DEBIAN_FRONTEND=noninteractive
60-
sudo apt-get update
61-
sudo apt-get install krb5-kdc krb5-otp libkrb5-dev \
62-
libsocket-wrapper libnss-wrapper krb5-admin-server libdb5.3-dev
63+
uses: ./.github/actions/install-apt-deps
64+
with:
65+
packages: krb5-kdc krb5-otp libkrb5-dev libsocket-wrapper libnss-wrapper krb5-admin-server libdb5.3-dev
6366

6467
- name: Download lib
6568
uses: actions/download-artifact@v4
@@ -74,13 +77,15 @@ jobs:
7477
with:
7578
repository: wolfssl/osp
7679
path: osp
80+
fetch-depth: 1
7781

7882
- name: Checkout sasl
7983
uses: actions/checkout@v4
8084
with:
8185
repository: cyrusimap/cyrus-sasl
8286
ref: cyrus-sasl-${{ matrix.ref }}
8387
path: sasl
88+
fetch-depth: 1
8489

8590
- name: Build cyrus-sasl
8691
working-directory: sasl

0 commit comments

Comments
 (0)