Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/stm32h5-tls-m33mu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: STM32H5 TLS Demo (m33mu + VDE)

on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]

jobs:
stm32h5_tls_test:
runs-on: ubuntu-latest
container:
image: ghcr.io/danielinux/m33mu-ci:1.3

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: false

- name: Clone wolfSSL
working-directory: /tmp
run: |
git clone --depth 1 https://github.com/wolfSSL/wolfssl.git
echo "wolfSSL cloned to /tmp/wolfssl"

- name: Build TLS Server + Client Binaries
working-directory: src/port/stm32h563
run: |
CC=arm-none-eabi-gcc OBJCOPY=arm-none-eabi-objcopy \
make test-m33mu WOLFSSL_ROOT=/tmp/wolfssl
ls -lh app-server.bin
echo "Server binary size: $(stat -c%s app-server.bin) bytes"
ls -lh app-client.bin
echo "Client binary size: $(stat -c%s app-client.bin) bytes"

- name: Start VDE Switch
run: |
vde_switch -s /tmp/vde_switch.ctl -d
sleep 2
echo "VDE switch started"

- name: Run TLS Server (m33mu)
working-directory: src/port/stm32h563
run: |
m33mu --vde /tmp/vde_switch.ctl --expect-bkpt 0x7f --timeout 60 app-server.bin > server.log 2>&1 &
SERVER_PID=$!
echo "Server started with PID $SERVER_PID"
echo $SERVER_PID > /tmp/server.pid
sleep 5
echo "Server log (first 50 lines):"
head -50 server.log || true

- name: Run TLS Client (m33mu)
working-directory: src/port/stm32h563
run: |
m33mu --vde /tmp/vde_switch.ctl --expect-bkpt 0x7f --timeout 60 app-client.bin > client.log 2>&1
CLIENT_EXIT=$?
echo "Client exit code: $CLIENT_EXIT"
echo "Client log:"
cat client.log
if [ $CLIENT_EXIT -ne 0 ]; then
echo "ERROR: Client test failed!"
exit $CLIENT_EXIT
fi

- name: Check Server Result
working-directory: src/port/stm32h563
run: |
SERVER_PID=$(cat /tmp/server.pid)
# Wait a bit for server to finish
sleep 2
# Check if server is still running
if kill -0 $SERVER_PID 2>/dev/null; then
echo "Server still running, waiting for completion..."
wait $SERVER_PID || true
fi
SERVER_EXIT=$?
echo "Server exit code: $SERVER_EXIT"
echo "Server log:"
cat server.log
if [ $SERVER_EXIT -ne 0 ] && [ $SERVER_EXIT -ne 143 ]; then
echo "ERROR: Server test failed!"
exit 1
fi

- name: Cleanup
if: always()
run: |
killall vde_switch 2>/dev/null || true
killall m33mu 2>/dev/null || true
rm -rf /tmp/vde_switch.ctl

- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: m33mu-logs
path: |
src/port/stm32h563/server.log
src/port/stm32h563/client.log
Loading
Loading