From 3ddfe8f55bb673e43d5737d8519fe1076d608db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietrich=20Kr=C3=B6nke?= Date: Wed, 22 Sep 2021 16:03:35 +0200 Subject: [PATCH] iox-#910 Add CI jobs for latest gcc and clang --- .github/workflows/build-test.yml | 30 +++++++++++++--- tools/ci/build-test-ubuntu-with-sanitizers.sh | 24 ++++++++++--- tools/ci/build-test-ubuntu.sh | 2 +- ... => build-ubuntu-with-latest-clang-gcc.sh} | 36 ++++++++++--------- 4 files changed, 67 insertions(+), 25 deletions(-) rename tools/ci/{build-test-ubuntu-with-latest-clang.sh => build-ubuntu-with-latest-clang-gcc.sh} (63%) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b6f3da8b42b..f89e6e24276 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -56,12 +56,23 @@ jobs: - uses: actions/checkout@v2 - run: ./tools/ci/run-integration-test.sh - build-test-ubuntu-with-sanitizers: + build-test-ubuntu-with-sanitizers-gcc: + runs-on: ubuntu-20.04 + needs: pre-flight-check + steps: + - uses: egor-tensin/setup-gcc@v1 + with: + version: latest + platform: x64 + - uses: actions/checkout@v2 + - run: ./tools/ci/build-test-ubuntu-with-sanitizers.sh gcc + + build-test-ubuntu-with-sanitizers-clang: runs-on: ubuntu-20.04 needs: pre-flight-check steps: - uses: actions/checkout@v2 - - run: ./tools/ci/build-test-ubuntu-with-sanitizers.sh + - run: ./tools/ci/build-test-ubuntu-with-sanitizers.sh clang build-test-macos-with-sanitizers: runs-on: macos-latest @@ -72,12 +83,23 @@ jobs: - uses: actions/checkout@v2 - run: ./tools/ci/build-test-macos-with-sanitizers.sh - build-test-ubuntu-with-latest-clang: + build-ubuntu-with-latest-clang-release: runs-on: ubuntu-latest needs: pre-flight-check steps: - uses: actions/checkout@v2 - - run: ./tools/ci/build-test-ubuntu-with-latest-clang.sh + - run: ./tools/ci/build-ubuntu-with-latest-clang-gcc.sh clang + + build-ubuntu-with-latest-gcc-release: + runs-on: ubuntu-latest + needs: pre-flight-check + steps: + - uses: egor-tensin/setup-gcc@v1 + with: + version: latest + platform: x64 + - uses: actions/checkout@v2 + - run: ./tools/ci/build-ubuntu-with-latest-clang-gcc.sh gcc # gcc 5.4 is compiler used in QNX 7.0 build-test-ubuntu-with-gcc54: diff --git a/tools/ci/build-test-ubuntu-with-sanitizers.sh b/tools/ci/build-test-ubuntu-with-sanitizers.sh index c10c59ca2e0..d2a93f2734e 100755 --- a/tools/ci/build-test-ubuntu-with-sanitizers.sh +++ b/tools/ci/build-test-ubuntu-with-sanitizers.sh @@ -19,6 +19,8 @@ set -e +COMPILER=${1:-gcc} + msg() { printf "\033[1;32m%s: %s\033[0m\n" ${FUNCNAME[1]} "$1" } @@ -29,15 +31,29 @@ cd ${WORKSPACE} msg "installing build dependencies" sudo apt-get update && sudo apt-get install -y libacl1-dev libncurses5-dev +if [ "$COMPILER" == "clang" ]; then + msg "installing latest stable clang" + wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh + chmod +x /tmp/llvm.sh + # set LLVM_VERSION + eval $(cat /tmp/llvm.sh | grep LLVM_VERSION= -m 1) + sudo /tmp/llvm.sh ${LLVM_VERSION} +fi + msg "creating local test users and groups for testing access control" sudo ./tools/add_test_users.sh -msg "compiler versions: -$(gcc --version) -$(clang --version)" msg "building sources" -./tools/iceoryx_build_test.sh clean build-strict build-strict build-all clang sanitize test-add-user +if [ "$COMPILER" == "gcc" ]; then + ./tools/iceoryx_build_test.sh clean build-strict build-strict build-all debug sanitize test-add-user +fi + +if [ "$COMPILER" == "clang" ]; then + export CC=clang-${LLVM_VERSION} + export CXX=clang++-${LLVM_VERSION} + ./tools/iceoryx_build_test.sh clean build-strict build-strict build-all clang debug sanitize test-add-user +fi msg "running all tests" cd ./build diff --git a/tools/ci/build-test-ubuntu.sh b/tools/ci/build-test-ubuntu.sh index 0b61428bcd0..e34fa6941ab 100755 --- a/tools/ci/build-test-ubuntu.sh +++ b/tools/ci/build-test-ubuntu.sh @@ -48,4 +48,4 @@ cd ./build cd - msg "building roudi examples without toml support" -./tools/iceoryx_build_test.sh out-of-tree examples toml-config-off clean +./tools/iceoryx_build_test.sh relwithdebinfo out-of-tree examples toml-config-off clean diff --git a/tools/ci/build-test-ubuntu-with-latest-clang.sh b/tools/ci/build-ubuntu-with-latest-clang-gcc.sh similarity index 63% rename from tools/ci/build-test-ubuntu-with-latest-clang.sh rename to tools/ci/build-ubuntu-with-latest-clang-gcc.sh index 4106008a3bf..73ebd5c1b1d 100755 --- a/tools/ci/build-test-ubuntu-with-latest-clang.sh +++ b/tools/ci/build-ubuntu-with-latest-clang-gcc.sh @@ -19,6 +19,8 @@ set -e +COMPILER=${1:-gcc} + msg() { printf "\033[1;32m%s: %s\033[0m\n" ${FUNCNAME[1]} "$1" } @@ -29,25 +31,27 @@ cd ${WORKSPACE} msg "installing build dependencies" sudo apt-get update && sudo apt-get install -y libacl1-dev libncurses5-dev -msg "installing latest stable clang" -wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh -chmod +x /tmp/llvm.sh -# set LLVM_VERSION -eval $(cat /tmp/llvm.sh | grep LLVM_VERSION= -m 1) -sudo /tmp/llvm.sh ${LLVM_VERSION} +if [ "$COMPILER" == "clang" ]; then + msg "installing latest stable clang" + wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh + chmod +x /tmp/llvm.sh + # set LLVM_VERSION + eval $(cat /tmp/llvm.sh | grep LLVM_VERSION= -m 1) + sudo /tmp/llvm.sh ${LLVM_VERSION} +fi msg "creating local test users and groups for testing access control" sudo ./tools/add_test_users.sh -msg "compiler versions: -$(clang-${LLVM_VERSION} --version)" msg "building sources" -export CC=clang-${LLVM_VERSION} -export CXX=clang++-${LLVM_VERSION} -./tools/iceoryx_build_test.sh clean build-all out-of-tree build-shared test-add-user - -msg "running all tests" -cd ./build -./tools/run_tests.sh all -cd - + +if [ "$COMPILER" == "gcc" ]; then + ./tools/iceoryx_build_test.sh clean release build-all out-of-tree build-shared test-add-user +fi + +if [ "$COMPILER" == "clang" ]; then + export CC=clang-${LLVM_VERSION} + export CXX=clang++-${LLVM_VERSION} + ./tools/iceoryx_build_test.sh clean clang release build-all out-of-tree build-shared test-add-user +fi