diff --git a/.github/workflows/actions_build.yml b/.github/workflows/actions_build.yml index 68466c5d..b97aac16 100644 --- a/.github/workflows/actions_build.yml +++ b/.github/workflows/actions_build.yml @@ -3,9 +3,9 @@ name: Github Actions Build on: [push] env: - COMMS_TAG: v5.2.6 - CC_MQTTSN_TAG: v2.8.1 - CC_MQTT311_TAG: v2.8 + COMMS_TAG: develop + CC_MQTTSN_TAG: develop + CC_MQTT311_TAG: develop jobs: build_gcc_ubuntu_22_04: @@ -16,6 +16,10 @@ jobs: type: [Debug, Release, MinSizeRel] cc_ver: [9, 10, 11, 12] cpp: [17, 20] + sanitize: [ON, OFF] + exclude: + - type: Debug + sanitize: OFF steps: - uses: actions/checkout@v4 @@ -50,7 +54,7 @@ jobs: run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_CXX_STANDARD=${{matrix.cpp}} \ -DCMAKE_INSTALL_PREFIX=install -DCMAKE_PREFIX_PATH=${{runner.workspace}}/build/install \ - -DCC_MQTTSN_BUILD_UNIT_TESTS=ON -DCC_MQTTSN_WITH_SANITIZERS=ON \ + -DCC_MQTTSN_BUILD_UNIT_TESTS=ON -DCC_MQTTSN_WITH_SANITIZERS=${{matrix.sanitize}} \ -DCC_MQTTSN_CUSTOM_CLIENT_CONFIG_FILES="$GITHUB_WORKSPACE/client/lib/script/BareMetalTestConfig.cmake;$GITHUB_WORKSPACE/client/lib/script/NoGwDiscoverConfig.cmake;$GITHUB_WORKSPACE/client/lib/script/Qos1Config.cmake;$GITHUB_WORKSPACE/client/lib/script/Qos0Config.cmake" env: CC: gcc-${{matrix.cc_ver}} @@ -75,7 +79,13 @@ jobs: matrix: type: [Debug, Release, MinSizeRel] cc_ver: [13, 14] - cpp: [17, 20] + cpp: [17, 20, 23] + sanitize: [ON, OFF] + exclude: + - type: Debug + sanitize: OFF + - cc_ver: 13 + cpp: 23 steps: - uses: actions/checkout@v4 @@ -110,7 +120,7 @@ jobs: run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_CXX_STANDARD=${{matrix.cpp}} \ -DCMAKE_INSTALL_PREFIX=install -DCMAKE_PREFIX_PATH=${{runner.workspace}}/build/install \ - -DCC_MQTTSN_BUILD_UNIT_TESTS=ON -DCC_MQTTSN_WITH_SANITIZERS=ON \ + -DCC_MQTTSN_BUILD_UNIT_TESTS=ON -DCC_MQTTSN_WITH_SANITIZERS=${{matrix.sanitize}} \ -DCC_MQTTSN_CUSTOM_CLIENT_CONFIG_FILES="$GITHUB_WORKSPACE/client/lib/script/BareMetalTestConfig.cmake;$GITHUB_WORKSPACE/client/lib/script/NoGwDiscoverConfig.cmake;$GITHUB_WORKSPACE/client/lib/script/Qos1Config.cmake;$GITHUB_WORKSPACE/client/lib/script/Qos0Config.cmake" env: CC: gcc-${{matrix.cc_ver}} @@ -136,7 +146,10 @@ jobs: type: [Debug, Release, MinSizeRel] cc_ver: [11, 12, 13, 14, 15] cpp: [17, 20] + sanitize: [ON, OFF] exclude: + - type: Debug + sanitize: OFF - cc_ver: 11 cpp: 20 - cc_ver: 12 @@ -145,6 +158,8 @@ jobs: cpp: 20 - cc_ver: 14 cpp: 20 + - cc_ver: 11 + sanitize: ON steps: - uses: actions/checkout@v4 @@ -179,12 +194,11 @@ jobs: run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_CXX_STANDARD=${{matrix.cpp}} \ -DCMAKE_INSTALL_PREFIX=install -DCMAKE_PREFIX_PATH=${{runner.workspace}}/build/install \ - -DCC_MQTTSN_BUILD_UNIT_TESTS=ON -DCC_MQTTSN_WITH_SANITIZERS=${{env.WITH_SANITIZERS}} \ + -DCC_MQTTSN_BUILD_UNIT_TESTS=ON -DCC_MQTTSN_WITH_SANITIZERS=${{matrix.sanitize}} \ -DCC_MQTTSN_CUSTOM_CLIENT_CONFIG_FILES="$GITHUB_WORKSPACE/client/lib/script/BareMetalTestConfig.cmake;$GITHUB_WORKSPACE/client/lib/script/NoGwDiscoverConfig.cmake;$GITHUB_WORKSPACE/client/lib/script/Qos1Config.cmake;$GITHUB_WORKSPACE/client/lib/script/Qos0Config.cmake" env: CC: clang-${{matrix.cc_ver}} CXX: clang++-${{matrix.cc_ver}} - WITH_SANITIZERS: "${{ (matrix.cc_ver == 11) && 'OFF' || 'ON' }}" - name: Build working-directory: ${{runner.workspace}}/build @@ -205,7 +219,15 @@ jobs: matrix: type: [Debug, Release, MinSizeRel] cc_ver: [16, 17, 18] - cpp: [17, 20] + cpp: [17, 20, 23] + sanitize: [ON, OFF] + exclude: + - type: Debug + sanitize: OFF + - cc_ver: 16 + cpp: 23 + - cc_ver: 17 + cpp: 23 steps: - uses: actions/checkout@v4 @@ -240,7 +262,7 @@ jobs: run: | cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_CXX_STANDARD=${{matrix.cpp}} \ -DCMAKE_INSTALL_PREFIX=install -DCMAKE_PREFIX_PATH=${{runner.workspace}}/build/install \ - -DCC_MQTTSN_BUILD_UNIT_TESTS=ON -DCC_MQTTSN_WITH_SANITIZERS=ON \ + -DCC_MQTTSN_BUILD_UNIT_TESTS=ON -DCC_MQTTSN_WITH_SANITIZERS=${{matrix.sanitize}} \ -DCC_MQTTSN_CUSTOM_CLIENT_CONFIG_FILES="$GITHUB_WORKSPACE/client/lib/script/BareMetalTestConfig.cmake;$GITHUB_WORKSPACE/client/lib/script/NoGwDiscoverConfig.cmake;$GITHUB_WORKSPACE/client/lib/script/Qos1Config.cmake;$GITHUB_WORKSPACE/client/lib/script/Qos0Config.cmake" env: CC: clang-${{matrix.cc_ver}} diff --git a/script/full_build.sh b/script/full_build.sh new file mode 100755 index 00000000..a83227e1 --- /dev/null +++ b/script/full_build.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +if [ -z "${CC}" -o -z "${CXX}" ]; then + echo "ERROR: Compilers are not provided" + exit 1 +fi + +if [ -z "${COMMON_BUILD_TYPE}" ]; then + echo "ERROR: build type is not provided" + exit 1 +fi + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +ROOT_DIR=$( dirname ${SCRIPT_DIR} ) +export BUILD_DIR="${ROOT_DIR}/build.full.${CC}.${COMMON_BUILD_TYPE}" +export COMMON_INSTALL_DIR=${BUILD_DIR}/install +export EXTERNALS_DIR=${ROOT_DIR}/externals +mkdir -p ${BUILD_DIR} + +${SCRIPT_DIR}/prepare_externals.sh + +CONFIGS_DIR="${ROOT_DIR}/client/lib/script" +CONFIGS="${CONFIGS_DIR}/BareMetalTestConfig.cmake;${CONFIGS_DIR}/NoGwDiscoverConfig.cmake;${CONFIGS_DIR}/Qos1Config.cmake;${CONFIGS_DIR}/Qos0Config.cmake" + +cd ${BUILD_DIR} +cmake .. -DCMAKE_INSTALL_PREFIX=${COMMON_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} \ + -DCC_MQTTSN_USE_CCACHE=ON \ + -DCC_MQTTSN_WITH_SANITIZERS=ON -DCC_MQTTSN_BUILD_UNIT_TESTS=ON \ + -DCC_MQTTSN_CUSTOM_CLIENT_CONFIG_FILES="${CONFIGS}" \ + "$@" + +procs=$(nproc) +if [ -n "${procs}" ]; then + procs_param="--parallel ${procs}" +fi + +cmake --build ${BUILD_DIR} --config ${COMMON_BUILD_TYPE} --target install ${procs_param} diff --git a/script/full_debug_build.sh b/script/full_debug_build.sh index fff8400e..4ed7b1e7 100755 --- a/script/full_debug_build.sh +++ b/script/full_debug_build.sh @@ -1,33 +1,5 @@ #!/bin/bash -if [ -z "${CC}" -o -z "${CXX}" ]; then - echo "ERROR: Compilers are not provided" - exit 1 -fi - SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -ROOT_DIR=$( dirname ${SCRIPT_DIR} ) -export BUILD_DIR="${ROOT_DIR}/build.full.${CC}" -export COMMON_INSTALL_DIR=${BUILD_DIR}/install export COMMON_BUILD_TYPE=Debug -export EXTERNALS_DIR=${ROOT_DIR}/externals -mkdir -p ${BUILD_DIR} - -${SCRIPT_DIR}/prepare_externals.sh - -CONFIGS_DIR="${ROOT_DIR}/client/lib/script" -CONFIGS="${CONFIGS_DIR}/BareMetalTestConfig.cmake;${CONFIGS_DIR}/NoGwDiscoverConfig.cmake;${CONFIGS_DIR}/Qos1Config.cmake;${CONFIGS_DIR}/Qos0Config.cmake" - -cd ${BUILD_DIR} -cmake .. -DCMAKE_INSTALL_PREFIX=${COMMON_INSTALL_DIR} -DCMAKE_BUILD_TYPE=Debug \ - -DCC_MQTTSN_USE_CCACHE=ON \ - -DCC_MQTTSN_WITH_SANITIZERS=ON -DCC_MQTTSN_BUILD_UNIT_TESTS=ON \ - -DCC_MQTTSN_CUSTOM_CLIENT_CONFIG_FILES="${CONFIGS}" \ - "$@" - -procs=$(nproc) -if [ -n "${procs}" ]; then - procs_param="--parallel ${procs}" -fi - -cmake --build ${BUILD_DIR} --config ${COMMON_BUILD_TYPE} --target install ${procs_param} +${SCRIPT_DIR}/full_build.sh "$@" diff --git a/script/full_debug_build_clang.sh b/script/full_debug_build_clang.sh index fc808781..655ab13a 100755 --- a/script/full_debug_build_clang.sh +++ b/script/full_debug_build_clang.sh @@ -1,7 +1,13 @@ #!/bin/bash -export CC=clang -export CXX=clang++ +if [ -z "${CC}" ]; then + export CC=clang +fi + +if [ -z "${CXX}" ]; then + export CXX=clang++ +fi + SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ${SCRIPT_DIR}/full_debug_build.sh "$@" diff --git a/script/full_debug_build_gcc.sh b/script/full_debug_build_gcc.sh index 10191349..be66c329 100755 --- a/script/full_debug_build_gcc.sh +++ b/script/full_debug_build_gcc.sh @@ -1,7 +1,12 @@ #!/bin/bash -export CC=gcc -export CXX=g++ +if [ -z "${CC}" ]; then + export CC=gcc +fi + +if [ -z "${CXX}" ]; then + export CXX=g++ +fi SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ${SCRIPT_DIR}/full_debug_build.sh "$@" diff --git a/script/full_release_build.sh b/script/full_release_build.sh new file mode 100755 index 00000000..aaba5946 --- /dev/null +++ b/script/full_release_build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +export COMMON_BUILD_TYPE=Release +${SCRIPT_DIR}/full_build.sh "$@" diff --git a/script/full_release_build_clang.sh b/script/full_release_build_clang.sh new file mode 100755 index 00000000..cd603894 --- /dev/null +++ b/script/full_release_build_clang.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ -z "${CC}" ]; then + export CC=clang +fi + +if [ -z "${CXX}" ]; then + export CXX=clang++ +fi + + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +${SCRIPT_DIR}/full_release_build.sh "$@" + diff --git a/script/full_release_build_gcc.sh b/script/full_release_build_gcc.sh new file mode 100755 index 00000000..2cbaab13 --- /dev/null +++ b/script/full_release_build_gcc.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ -z "${CC}" ]; then + export CC=gcc +fi + +if [ -z "${CXX}" ]; then + export CXX=g++ +fi + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +${SCRIPT_DIR}/full_release_build.sh "$@" +