Skip to content

Commit

Permalink
Testing release builds without sanitizers.
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Sep 19, 2024
1 parent 6b5afb5 commit eddeabe
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 43 deletions.
42 changes: 32 additions & 10 deletions .github/workflows/actions_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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}}
Expand All @@ -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
Expand Down Expand Up @@ -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}}
Expand All @@ -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
Expand All @@ -145,6 +158,8 @@ jobs:
cpp: 20
- cc_ver: 14
cpp: 20
- cc_ver: 11
sanitize: ON

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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}}
Expand Down
37 changes: 37 additions & 0 deletions script/full_build.sh
Original file line number Diff line number Diff line change
@@ -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}
30 changes: 1 addition & 29 deletions script/full_debug_build.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
10 changes: 8 additions & 2 deletions script/full_debug_build_clang.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
Expand Down
9 changes: 7 additions & 2 deletions script/full_debug_build_gcc.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
Expand Down
5 changes: 5 additions & 0 deletions script/full_release_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export COMMON_BUILD_TYPE=Release
${SCRIPT_DIR}/full_build.sh "$@"
14 changes: 14 additions & 0 deletions script/full_release_build_clang.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"

13 changes: 13 additions & 0 deletions script/full_release_build_gcc.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"

0 comments on commit eddeabe

Please sign in to comment.