From 63968b9fbcd787de4923edaa7ba440be7ff07d97 Mon Sep 17 00:00:00 2001 From: Brett Nicholas <7547222+bigbrett@users.noreply.github.com> Date: Wed, 10 Apr 2024 09:13:34 -0600 Subject: [PATCH] first stab at basic CI --- .github/workflows/build-and-test.yml | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/build-and-test.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..b707ba9 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,56 @@ +name: Build and Test + +on: + push: + branches: [ 'master', 'main', 'release/**' ] + pull_request: + branches: [ '*' ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + # pull and build wolfssl + - name: Checkout wolfssl + uses: actions/checkout@master + with: + repository: wolfssl/wolfssl + path: wolfssl + + # pull and build wolhsm + - name: Checkout wolfhsm + uses: actions/checkout@master + with: + repository: wolfssl/wolfhsm + path: wolfhsm + + # Build examples + - name: Build POSIX TCP server + run: ls && cd posix/tcp/wh_server_tcp && make WOLFSSL_DIR=../../../wolfssl WOLFHSM_DIR=../../../wolfhsm + - name: Build POSIX TCP client + run: cd posix/tcp/wh_client_tcp && make WOLFSSL_DIR=../../../wolfssl WOLFHSM_DIR=../../../wolfhsm + + # Start the server in the background + - name: Run POSIX TCP server + run: | + cd posix/tcp/wh_server_tcp + ./Build/wh_server_tcp.elf & + TCP_SERVER_PID=$! + echo "TCP_SERVER_PID=$TCP_SERVER_PID" >> $GITHUB_ENV + + # Run the client that connects to the server + - name: Run POSIX TCP client + run: | + cd posix/tcp/wh_client_tcp + ./Build/wh_client_tcp.elf + + # Optional: Kill the server process if it doesn't exit on its own + - name: Cleanup POSIX TCP server + if: always() + run: kill $TCP_SERVER_PID || true + +