Merge pull request #453 from embhorn/cov-MQTT #75
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: ThreadXBuild Test | |
| on: | |
| push: | |
| branches: [ 'master', 'main', 'release/**' ] | |
| pull_request: | |
| branches: [ '*' ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| # Don't prompt for anything | |
| export DEBIAN_FRONTEND=noninteractive | |
| sudo apt-get update | |
| # Install mosquitto | |
| sudo apt-get install -y mosquitto bubblewrap cmake gcc-arm-none-eabi | |
| - name: Setup mosquitto broker | |
| run: | | |
| # Disable default broker daemon | |
| sudo service mosquitto stop | |
| sleep 1 | |
| # This is some debug info useful if something goes wrong | |
| - name: Show network status | |
| run: | | |
| sudo ifconfig | |
| sudo route | |
| sudo netstat -tulpan | |
| - name: Cache NetXDuo bundle | |
| id: cache-netxduo | |
| uses: actions/cache@v3 | |
| with: | |
| path: ./v6.4.3_rel.tar.gz | |
| key: netxduo-bundle-v6.4.3_rel | |
| - name: Download NetXDuo bundle if not cached | |
| if: steps.cache-netxduo.outputs.cache-hit != 'true' | |
| run: | | |
| wget https://github.com/eclipse-threadx/netxduo/archive/refs/tags/v6.4.3_rel.tar.gz | |
| - name: Extract NetXDuo bundle | |
| run: | | |
| mkdir -p netxduo_src | |
| tar -xzf v6.4.3_rel.tar.gz -C netxduo_src --strip-components=1 | |
| - name: Install NetXDuo Dependencies | |
| working-directory: ./netxduo_src | |
| run: | | |
| ./scripts/install.sh | |
| - name: Configure NetX with DNS Client Support | |
| working-directory: ./netxduo_src | |
| run: | | |
| cp addons/dns/nxd_dns.h ./common/inc/ | |
| cp addons/dns/nxd_dns.c ./common/src/ | |
| - name: Build NetXDuo with DNS Support | |
| working-directory: ./netxduo_src | |
| run: | | |
| rm -rf test/cmake/threadx | |
| rm -rf test/cmake/filex | |
| ./scripts/build_nxd64.sh | |
| - uses: actions/checkout@master | |
| with: | |
| repository: wolfssl/wolfssl | |
| path: wolfssl | |
| - name: wolfssl autogen | |
| working-directory: ./wolfssl | |
| run: ./autogen.sh | |
| - name: wolfssl configure | |
| working-directory: ./wolfssl | |
| run: ./configure --enable-enckeys --disable-examples --disable-benchmark --disable-crypttests CPPFLAGS="-DTHREADX -DHAVE_NETX -DWOLFSSL_USER_IO -I${{ github.workspace }}/netxduo_src/common/inc -I${{ github.workspace }}/netxduo_src/ports/linux/gnu/inc -I${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/inc" LDFLAGS="-L${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/default_build_coverage/netxduo -L${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/threadx" LIBS="-lnetxduo -lthreadx" | |
| - name: wolfssl make | |
| working-directory: ./wolfssl | |
| run: | | |
| sed -i 's/ -Werror//' Makefile | |
| make | |
| - name: wolfssl make install | |
| working-directory: ./wolfssl | |
| run: | | |
| sudo make install | |
| sudo ldconfig | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: wolfmqtt | |
| - name: Change wolfmqtt configure.ac | |
| working-directory: ./wolfmqtt | |
| run: | | |
| # ThreadX requires tx_application_define(void*) as an entry point | |
| # this causes the simple conftest.c created by autoconf to fail when | |
| # checking for wolfssl. Removing the check for wolfssl here. | |
| sed -i '/AC_CHECK_LIB(\[wolfssl\],/d' configure.ac | |
| - name: wolfmqtt autogen | |
| working-directory: ./wolfmqtt | |
| run: ./autogen.sh | |
| - name: wolfmqtt configure with Multi-threading | |
| working-directory: ./wolfmqtt | |
| run: ./configure --enable-tls --enable-mt --disable-examples --disable-stdincap CPPFLAGS="-DTHREADX -DHAVE_NETX -DWOLFSSL_USER_IO -DNO_MAIN_DRIVER -I${{ github.workspace }}/netxduo_src/common/inc -I${{ github.workspace }}/netxduo_src/ports/linux/gnu/inc -I${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/inc" LDFLAGS="-L${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/default_build_coverage/netxduo -L${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/threadx" LIBS="-lnetxduo -lthreadx -lwolfssl" | |
| - name: wolfmqtt make | |
| working-directory: ./wolfmqtt | |
| run: | | |
| make | |
| sudo make install | |
| - name: Compile ThreadX NetX test app | |
| working-directory: ./wolfmqtt | |
| run: | | |
| gcc -DHAVE_NETX -o threadx_netx examples/threadx/threadx_netx.c examples/mqttnet.c examples/mqttexample.c -I. -I${{ github.workspace }}/netxduo_src/common/inc -I${{ github.workspace }}/netxduo_src/ports/linux/gnu/inc -I${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/inc -I${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/threadx -L${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/default_build_coverage/netxduo -L${{ github.workspace }}/netxduo_src/test/cmake/netxduo64/build/libs/threadx -lnetxduo -lthreadx -lwolfssl -lwolfmqtt | |
| # capture logs on failure | |
| - name: Show logs on failure | |
| if: failure() || cancelled() | |
| run: | | |
| set +e | |
| cat wolfmqtt/test-suite.log | |
| cat wolfmqtt/scripts/*.log | |
| cat wolfmqtt/config.log | |
| ls /usr/local/lib/* | |
| file /usr/local/lib/libwolfssl.so |