-
Notifications
You must be signed in to change notification settings - Fork 30
83 lines (71 loc) · 2.77 KB
/
build-and-run-examples.yml
File metadata and controls
83 lines (71 loc) · 2.77 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
name: Build and Run Examples
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
jobs:
build:
strategy:
matrix:
transport: [ 'tcp', 'shm', 'dma', 'tls', 'psk' ]
asan: [ 'ASAN=1', 'ASAN=0' ]
debug: [ '', 'DEBUG_VERBOSE=1' ]
test: [ '', '--test' ]
auth: [ '', 'AUTH=1' ]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@master
# pull and build wolfssl
- name: Checkout wolfssl
uses: actions/checkout@master
with:
repository: wolfssl/wolfssl
path: wolfssl
- name: Set TLS Environment Variable
run: |
if [ "${{ matrix.transport }}" = "tls" ] || [ "${{ matrix.transport }}" = "psk" ]; then
echo "TLS=1" >> $GITHUB_ENV
else
echo "TLS=0" >> $GITHUB_ENV
fi
# Build examples
- name: Build POSIX server
run: |
if [ "${{ matrix.transport }}" = "dma" ]; then
cd examples/posix/wh_posix_server && ${{ matrix.asan }} ${{ matrix.debug }} ${{ matrix.auth }} DMA=1 make -j WOLFSSL_DIR=../../../wolfssl
else
cd examples/posix/wh_posix_server && ${{ matrix.asan }} ${{ matrix.debug }} ${{ matrix.auth }} TLS=${{ env.TLS }} make -j WOLFSSL_DIR=../../../wolfssl
fi
- name: Build POSIX client
run: |
if [ "${{ matrix.transport }}" = "dma" ]; then
cd examples/posix/wh_posix_client && ${{ matrix.asan }} ${{ matrix.debug }} ${{ matrix.auth }} DMA=1 make -j WOLFSSL_DIR=../../../wolfssl
else
cd examples/posix/wh_posix_client && ${{ matrix.asan }} ${{ matrix.debug }} ${{ matrix.auth }} TLS=${{ env.TLS }} make -j WOLFSSL_DIR=../../../wolfssl
fi
# Start the server in the background
- name: Run POSIX server
run: |
cd examples/posix/wh_posix_server
if [ "${{ matrix.transport }}" = "psk" ]; then
echo "test_password" | ./Build/wh_posix_server.elf --type ${{ matrix.transport }} &
else
./Build/wh_posix_server.elf --type ${{ matrix.transport }} &
fi
POSIX_SERVER_PID=$!
echo "POSIX_SERVER_PID=$POSIX_SERVER_PID" >> $GITHUB_ENV
# Run the client that connects to the server
- name: Run POSIX client
run: |
cd examples/posix/wh_posix_client
if [ "${{ matrix.transport }}" = "psk" ]; then
echo "test_password" | ./Build/wh_posix_client.elf --type ${{ matrix.transport }} ${{ matrix.test }}
else
./Build/wh_posix_client.elf --type ${{ matrix.transport }} ${{ matrix.test }}
fi
# Optional: Kill the server process if it doesn't exit on its own
- name: Cleanup POSIX server
if: always()
run: kill $POSIX_SERVER_PID || true