Add operation timeout - step 1 #574
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Run Examples | |
| on: | |
| push: | |
| branches: [ 'master', 'main', 'release/**' ] | |
| pull_request: | |
| branches: [ '*' ] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| transport: [ 'tcp', 'shm', 'dma' ] | |
| asan: [ 'ASAN=1', 'ASAN=0' ] | |
| debug: [ '', 'DEBUG_VERBOSE=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 | |
| # Build examples | |
| - name: Build POSIX server | |
| run: | | |
| if [ "${{ matrix.transport }}" = "dma" ]; then | |
| cd examples/posix/wh_posix_server && ${{ matrix.asan }} ${{ matrix.debug }} DMA=1 make -j WOLFSSL_DIR=../../../wolfssl | |
| else | |
| cd examples/posix/wh_posix_server && ${{ matrix.asan }} ${{ matrix.debug }} 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 }} DMA=1 make -j WOLFSSL_DIR=../../../wolfssl | |
| else | |
| cd examples/posix/wh_posix_client && ${{ matrix.asan }} ${{ matrix.debug }} make -j WOLFSSL_DIR=../../../wolfssl | |
| fi | |
| # Start the server in the background | |
| - name: Run POSIX server | |
| run: | | |
| cd examples/posix/wh_posix_server | |
| ./Build/wh_posix_server.elf --type ${{ matrix.transport }} & | |
| 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 | |
| ./Build/wh_posix_client.elf --type ${{ matrix.transport }} | |
| - name: Run POSIX demo test | |
| if: matrix.transport == 'tcp' | |
| run: | | |
| cd examples/posix/wh_posix_client | |
| ./Build/wh_posix_client.elf --type ${{ matrix.transport }} --test | |
| # 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 | |