Skip to content

Commit

Permalink
iox-eclipse-iceoryx#433 adapt Github workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Dietrich Krönke <[email protected]>
  • Loading branch information
dkroenke committed Dec 18, 2020
1 parent e821d5f commit d67892d
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 40 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Build sources
run: |
export NUM_CORES=`nproc`
$GITHUB_WORKSPACE/tools/iceoryx_build_test.sh buildall out-of-tree -j$NUM_CORES
$GITHUB_WORKSPACE/tools/iceoryx_build_test.sh strict buildall out-of-tree -j $NUM_CORES
- name: Run timeless tests
run: |
Expand Down Expand Up @@ -67,8 +67,8 @@ jobs:
- name: Build sources
run: |
export NUM_CORES=`nproc`
$GITHUB_WORKSPACE/tools/iceoryx_build_test.sh buildall out-of-tree -j$NUM_CORES
export NUM_CORES=`sysctl -n hw.ncpu`
$GITHUB_WORKSPACE/tools/iceoryx_build_test.sh strict build-test binding-c out-of-tree introspection -j $NUM_CORES
- name: Run tests
run: |
Expand All @@ -88,5 +88,4 @@ jobs:

- name: Build sources
run: |
export NUM_CORES=`nproc`
cmake -Bbuild -Hiceoryx_meta -DBUILD_TEST=ON -DINTROSPECTION=ON -DBINDING_C =ON -DEXAMPLES=ON && cmake --build build -j$NUM_CORES
cmake -Bbuild -Hiceoryx_meta -DBUILD_TEST=ON -DINTROSPECTION=OFF -DBINDING_C=ON -DEXAMPLES=ON && cmake --build build
12 changes: 7 additions & 5 deletions .github/workflows/sanitize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ on:
jobs:
clang-sanitize:
# The type of runner that the job will run on
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install iceoryx dependencies
# Softwares installed in ubuntu-18.04 instance
# https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu1804-README.md
run: sudo apt-get update && sudo apt-get install -y libacl1-dev libncurses5-dev
run: sudo apt-get update && sudo apt-get install -y libacl1-dev libncurses5-dev clang

- name : Checkout
uses: actions/checkout@v2
Expand All @@ -33,7 +33,7 @@ jobs:
- name : Run tests
run: |
cd $GITHUB_WORKSPACE/build
make all_tests
../tools/run_all_tests.sh
# This job builds & runs iceoryx tests (with sanitizer) in macos-10.15
clang-sanitize-macos:
Expand All @@ -60,12 +60,14 @@ jobs:
make install
- name: Build
run: $GITHUB_WORKSPACE/tools/iceoryx_build_test.sh build-test buildall sanitize clean
run: |
export NUM_CORES=`sysctl -n hw.ncpu`
$GITHUB_WORKSPACE/tools/iceoryx_build_test.sh build-test binding-c out-of-tree introspection strict sanitize clean -j $NUM_CORES
- name: Run tests
run: |
cd $GITHUB_WORKSPACE/build
make all_tests
../tools/run_all_tests.sh

1 change: 1 addition & 0 deletions iceoryx_meta/build_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ option(ROUDI_ENVIRONMENT"Build RouDi Environment for testing, is enabled when bu

if(BUILD_ALL)
set(EXAMPLES ON)
set(INTROSPECTION ON)
set(BUILD_TEST ON)
set(INTROSPECTION ON)
set(BINDING_C ON)
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_meta/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if (BUILD_TEST)

### create test target with Timing tests
foreach(cmp IN ITEMS ${COMPONENTS})
list(APPEND TIMINGTEST_CMD COMMAND ./${cmp}/test/${cmp}_componenttests --gtest_filter=*.TimingTest_* --gtest_output=xml:${CMAKE_BINARY_DIR}/testresults/${cmp}_ComponentResults.xml)
list(APPEND TIMINGTEST_CMD COMMAND ./${cmp}/test/${cmp}_moduletests --gtest_filter=*.TimingTest_* --gtest_output=xml:${CMAKE_BINARY_DIR}/testresults/${cmp}_ModuleTestResults.xml)
if(NOT (cmp STREQUAL "dds_gateway" OR cmp STREQUAL "binding_c"))
list(APPEND TIMINGTEST_CMD COMMAND ./${cmp}/test/${cmp}_integrationtests --gtest_filter=*.TimingTest_* --gtest_output=xml:${CMAKE_BINARY_DIR}/testresults/${cmp}_IntegrationTestResults.xml)
endif()
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_utils/cmake/IceoryxPlatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function(iox_create_lsan_runtime_blacklist BLACKLIST_FILE_PATH)
endif()
endfunction()

if(sanitize)
if(SANITIZE)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(ICEORYX_SANITIZER_BLACKLIST_FILE ${CMAKE_BINARY_DIR}/sanitizer_blacklist/asan_compile_time.txt)
iox_create_asan_compile_time_blacklist(${ICEORYX_SANITIZER_BLACKLIST_FILE})
Expand Down Expand Up @@ -130,4 +130,4 @@ if(sanitize)
else(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
message( FATAL_ERROR "You need to run sanitize with gcc/clang compiler." )
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
endif(sanitize)
endif(SANITIZE)
40 changes: 16 additions & 24 deletions tools/iceoryx_build_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ STRICT_FLAG="OFF"
TEST_FLAG="OFF"
EXAMPLE_FLAG="OFF"
COV_FLAG="OFF"
GCOV_SCOPE="all" #possible values for gcov test scope: 'all', 'unit', 'integration', 'component'
TEST_SCOPE="all" #possible values for gcov test scope: 'all', 'unit', 'integration'
QACPP_JSON="OFF"
RUN_TEST=false
INTROSPECTION_FLAG="ON"
INTROSPECTION_FLAG="OFF"
DDS_GATEWAY_FLAG="OFF"
ONE_TO_MANY_ONLY_FLAG="OFF"
SANITIZE_FLAG="OFF"
Expand All @@ -55,7 +55,7 @@ while (( "$#" )); do
;;
-c|--coverage)
echo "$2"
GCOV_SCOPE="$2"
TEST_SCOPE="$2"
BUILD_TYPE="Debug"
RUN_TEST=true
TEST_FLAG="ON"
Expand Down Expand Up @@ -114,6 +114,11 @@ while (( "$#" )); do
ROUDI_ENV_FLAG="ON"
shift 1
;;
"introspection")
echo " [i] Building Introspection"
INTROSPECTION_FLAG="ON"
shift 1
;;
"buildall")
echo " [i] Build complete iceoryx with all extensions"
DDS_GATEWAY_FLAG="ON"
Expand All @@ -133,14 +138,14 @@ while (( "$#" )); do
shift 1
;;
"sanitize")
echo "Build with sanitizers"
echo " [i] Build with sanitizers"
BUILD_TYPE="Debug"
TEST_FLAG="ON"
SANITIZE_FLAG="ON"
shift 1
;;
"clang")
echo "Build with clang compiler"
echo " [i] Build with clang compiler"
export CC=$(which clang)
export CXX=$(which clang++)
shift 1
Expand All @@ -154,7 +159,7 @@ while (( "$#" )); do
echo "Options:"
echo " -b --builddir Specify a non-default build directory"
echo " -j --jobs Specify the number of jobs to run simultaneously"
echo " -c --coverage Builds gcov and generate a html/xml report. Possible arguments: 'all', 'unit', 'integration', 'component'"
echo " -c --coverage Builds gcov and generate a html/xml report. Possible arguments: 'all', 'unit', 'integration'"
echo "Args:"
echo " clean Deletes the directory build/ before build"
echo " release Build release configuration"
Expand Down Expand Up @@ -220,7 +225,7 @@ cmake --build . --target install -- -j$NUM_JOBS
echo ">>>>>> Finished building iceoryx package <<<<<<"

# Dont build examples when coverage or sanitization is enabled
if [ "$COV_FLAG" == "OFF" ] || [ "$SANITIZE_FLAG" == "OFF" ] || [ "$OUT_OF_TREE_FLAG" == "ON" ]
if [ "$OUT_OF_TREE_FLAG" == "ON" ]
then
if [ "$BINDING_C_FLAG" == "ON" ]; then
EXAMPLES="${EXAMPLES} icedelivery_on_c waitset_on_c"
Expand Down Expand Up @@ -249,22 +254,15 @@ fi
#====================================================================================================
#==== Step 2 : Run all Tests =======================================================================
#====================================================================================================

if [ $RUN_TEST == true ]
then

# the absolute path of the directory assigned to the build
cd $BUILD_DIR
mkdir -p tools
cp $WORKSPACE/tools/run_all_tests.sh $BUILD_DIR/tools/run_all_tests.sh

echo " [i] Running all tests"
# if [ "$DDS_GATEWAY_FLAG" == "ON" ]
# then
# $BUILD_DIR/tools/run_all_tests.sh $GCOV_SCOPE with-dds-gateway-tests
# else
$BUILD_DIR/tools/run_all_tests.sh $GCOV_SCOPE
#fi
if [ $RUN_TEST == true ]; then
echo " [i] Running all tests"
$BUILD_DIR/tools/run_all_tests.sh $TEST_SCOPE
fi

for COMPONENT in $COMPONENTS; do

Expand All @@ -284,9 +282,6 @@ for COMPONENT in $COMPONENTS; do
esac
done

fi


if [ "$COV_FLAG" == "ON" ]
then
echo ">>>>>> Generate Gcov Report <<<<<<"
Expand All @@ -296,7 +291,4 @@ then
$WORKSPACE/tools/gcov/lcov_generate.sh $WORKSPACE remove #exclude all unnecessary files
$WORKSPACE/tools/gcov/lcov_generate.sh $WORKSPACE genhtml #generate html
echo ">>>>>> Report Generation complete <<<<<<"
#alternative with gcov currently disabled
#mkdir -p $BUILD_DIR/gcov
#gcovr -r $WORKSPACE --config $COV_OUTPUT
fi
11 changes: 8 additions & 3 deletions tools/run_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ execute_test() {
local test_binary=""

case $test_scope in
"all")
echo "Executing all tests"
make all_tests
;;
"unit")
echo "Executing unittests"
make module_tests
Expand All @@ -132,11 +136,12 @@ execute_test() {
echo ""
echo "######################## executing tests for $COMPONENT ########################"

if [ $TEST_SCOPE == "unit" ] || [ $TEST_SCOPE == "all" ]; then
if [ $TEST_SCOPE == "unit" ]; then
execute_test unit
fi
if [ $TEST_SCOPE == "integration" ] || [ $TEST_SCOPE == "all" ]; then
elif [ $TEST_SCOPE == "integration" ]; then
execute_test integration
elif [ $TEST_SCOPE == "all" ]; then
execute_test all
fi

# do not start RouDi while the module and componenttests are running;
Expand Down

0 comments on commit d67892d

Please sign in to comment.