Skip to content

Commit 053a225

Browse files
committed
mbed-tls 4 support
Signed-off-by: Peter M <petermm@gmail.com>
1 parent a7c2109 commit 053a225

File tree

16 files changed

+667
-162
lines changed

16 files changed

+667
-162
lines changed

.github/workflows/build-and-test-macos.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
matrix:
4141
os: ["macos-14", "macos-15", "macos-15-intel", "macos-26"]
4242
otp: ["24", "25", "26", "27", "28"]
43-
mbedtls: ["mbedtls@3"]
43+
mbedtls: ["mbedtls@3","mbedtls@4"]
4444
cmake_opts_other: [""]
4545

4646
include:

.github/workflows/build-libraries.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
runs-on: "ubuntu-22.04"
2020
strategy:
2121
fail-fast: false
22+
matrix:
23+
mbedtls: ["default", "mbedtls@4"]
2224

2325
steps:
2426
- name: "Checkout repo"
@@ -36,10 +38,26 @@ jobs:
3638

3739
- name: "Install deps"
3840
run: |
39-
sudo apt install -y build-essential cmake gperf zlib1g-dev libmbedtls-dev
41+
sudo apt install -y build-essential cmake gperf zlib1g-dev
42+
if [[ "${{ matrix.mbedtls }}" == "default" ]]; then
43+
sudo apt install -y libmbedtls-dev
44+
fi
4045
# Get a more recent valgrind
4146
sudo snap install valgrind --classic
4247
48+
- name: "Install specific MbedTLS version"
49+
if: matrix.mbedtls == 'mbedtls@4'
50+
run: |
51+
git clone --depth 1 --branch v4.0.0 https://github.com/Mbed-TLS/mbedtls
52+
cd mbedtls
53+
mkdir build
54+
cd build
55+
cmake -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=On -DCMAKE_INSTALL_PREFIX=/usr/local ..
56+
make -j$(nproc)
57+
sudo make install
58+
sudo ldconfig
59+
echo "MBEDTLS_ROOT_DIR=/usr/local" >> $GITHUB_ENV
60+
4361
# Builder info
4462
- name: "System info"
4563
run: |
@@ -64,7 +82,7 @@ jobs:
6482
- name: "Build: run cmake"
6583
working-directory: build
6684
run: |
67-
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
85+
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ${MBEDTLS_ROOT_DIR:+-DMBEDTLS_ROOT_DIR=$MBEDTLS_ROOT_DIR} ..
6886
6987
- name: "Build: run make"
7088
working-directory: build
@@ -122,7 +140,7 @@ jobs:
122140
123141
- name: Release
124142
uses: softprops/action-gh-release@v1
125-
if: startsWith(github.ref, 'refs/tags/')
143+
if: startsWith(github.ref, 'refs/tags/') && matrix.mbedtls == 'default'
126144
with:
127145
draft: true
128146
fail_on_unmatched_files: true

.github/workflows/esp32-simtest.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
paths:
1313
- ".github/workflows/esp32-simtest.yaml"
1414
- "CMakeLists.txt"
15-
- 'CMakeModules/**'
15+
- "CMakeModules/**"
1616
- "libs/**"
1717
- "src/platforms/esp32/**"
1818
- "src/platforms/esp32/**/**"
@@ -22,7 +22,7 @@ on:
2222
paths:
2323
- ".github/workflows/esp32-simtest.yaml"
2424
- "CMakeLists.txt"
25-
- 'CMakeModules/**'
25+
- "CMakeModules/**"
2626
- "libs/**"
2727
- "src/platforms/esp32/**"
2828
- "src/platforms/esp32/**/**"
@@ -78,9 +78,9 @@ jobs:
7878
"esp32c3",
7979
"esp32c5",
8080
"esp32c6",
81-
"esp32h2"
81+
"esp32h2",
8282
]
83-
idf-version: ${{ ((contains(github.event.head_commit.message, 'full_sim_test')||contains(github.event.pull_request.title, 'full_sim_test')) && fromJSON('["v5.1.6", "v5.2.6", "v5.3.4", "v5.4.3", "v5.5.2"]')) || fromJSON('["v5.5.2"]') }}
83+
idf-version: ${{ ((contains(github.event.head_commit.message, 'full_sim_test')||contains(github.event.pull_request.title, 'full_sim_test')) && fromJSON('["v5.1.6", "v5.2.6", "v5.3.4", "v5.4.3", "v5.5.2"]')) || fromJSON('["latest"]') }}
8484
exclude:
8585
- esp-idf-target: "esp32p4"
8686
idf-version: "v5.1.6"

0 commit comments

Comments
 (0)