diff --git a/.github/workflows/reusable-ubuntu-ci.yml b/.github/workflows/reusable-ubuntu-ci.yml index 72130b5d297..6eb2dcfc73c 100644 --- a/.github/workflows/reusable-ubuntu-ci.yml +++ b/.github/workflows/reusable-ubuntu-ci.yml @@ -683,6 +683,7 @@ jobs: show_skipped: 'False' fastdds_alternative_builds: + needs: fastdds_build runs-on: ${{ inputs.os-image }} strategy: fail-fast: false @@ -690,11 +691,11 @@ jobs: cmake-build-type: - 'RelWithDebInfo' steps: - - name: Sync eProsima/Fast-DDS repository - uses: eProsima/eProsima-CI/external/checkout@v0 + - name: Download build artifacts + uses: eProsima/eProsima-CI/external/download-artifact@v0 with: - path: src/fastrtps - ref: ${{ inputs.fastdds-branch }} + name: fastdds_build_${{ inputs.label }} + path: ${{ github.workspace }} - name: Install Fix Python version uses: eProsima/eProsima-CI/external/setup-python@v0 @@ -719,7 +720,7 @@ jobs: - name: Install Python dependencies uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 with: - packages: vcstool xmlschema + packages: vcstool xmlschema msparser upgrade: false - name: Setup CCache @@ -728,12 +729,38 @@ jobs: with: api_token: ${{ secrets.GITHUB_TOKEN }} - - name: Fetch Fast DDS dependencies - uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + - name: Sync osrf/osrf_testing_tools_cpp repository + uses: eProsima/eProsima-CI/external/checkout@v0 with: - vcs_repos_file: ${{ github.workspace }}/src/fastrtps/fastrtps.repos - destination_workspace: src - skip_existing: 'true' + repository: osrf/osrf_testing_tools_cpp + path: src/osrf_testing_tools_cpp + ref: 1.4.0 + + - name: OSRF testing tools build + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: '' + colcon_build_args: ${{ inputs.colcon-args }} --packages-select osrf_testing_tools_cpp + cmake_args: '-DBUILD_TESTING=OFF' + cmake_args_default: '' + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Profilling tests build + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/fastdds_build.meta + colcon_build_args: ${{ inputs.colcon-args }} --packages-up-to fastrtps + cmake_args: '-DPROFILING_TESTS=ON ${{ inputs.cmake-args }}' + cmake_args_default: ${{ env.colcon-build-default-cmake-args }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + workspace_dependencies: ${{ github.workspace }}/install + + - name: Clean workspace - Profiling tests + run: | + cd ${{ github.workspace }} + rm -rf build install log src/osrf_testing_tools_cpp - name: No security colcon build continue-on-error: true diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index db22b0b23c5..68de3fc9851 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -63,10 +63,7 @@ endif() # Profiling tests using valgrind ############################################################################### if(NOT ((MSVC OR MSVC_IDE)) AND PROFILING_TESTS) - find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) - if(CTEST_MEMORYCHECK_COMMAND) - add_subdirectory(profiling) - endif() + add_subdirectory(profiling) endif() ############################################################################### diff --git a/test/profiling/CMakeLists.txt b/test/profiling/CMakeLists.txt index 71a4092718d..09fd63897f9 100644 --- a/test/profiling/CMakeLists.txt +++ b/test/profiling/CMakeLists.txt @@ -54,6 +54,14 @@ if(Python3_Interpreter_FOUND) ############################################################################### # MemoryTest ############################################################################### + find_program(VALGRIND_PROGRAM NAMES valgrind) + + # If valgrind is not found, set it to "valgrind" so that the test can be run with + # the appropriate environment set at runtime. + if (${VALGRIND_PROGRAM} STREQUAL "valgrind-NOTFOUND") + set(VALGRIND_PROGRAM "valgrind") + endif() + add_test(NAME MemoryTest COMMAND ${Python3_EXECUTABLE} memory_tests.py) @@ -67,7 +75,7 @@ if(Python3_Interpreter_FOUND) set_property(TEST MemoryTest APPEND PROPERTY ENVIRONMENT "PROFILING_BINS=$") set_property(TEST MemoryTest APPEND PROPERTY ENVIRONMENT - "VALGRIND_BIN=${CTEST_MEMORYCHECK_COMMAND}") + "VALGRIND_BIN=${VALGRIND_PROGRAM}") if(SECURITY) set_property(TEST MemoryTest APPEND PROPERTY ENVIRONMENT "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs") @@ -89,7 +97,7 @@ if(Python3_Interpreter_FOUND) set_property(TEST CyclesTest APPEND PROPERTY ENVIRONMENT "PROFILING_BINS=$") set_property(TEST CyclesTest APPEND PROPERTY ENVIRONMENT - "VALGRIND_BIN=valgrind") + "VALGRIND_BIN=${VALGRIND_PROGRAM}") if(SECURITY) set_property(TEST CyclesTest APPEND PROPERTY ENVIRONMENT "CERTS_PATH=${PROJECT_SOURCE_DIR}/test/certs")