From 1d735ddacc3b72e4d1ffb3552a646d6bccaafc3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Mon, 17 Jun 2024 14:11:31 +0200 Subject: [PATCH] Refactor Fast DDS Ubuntu CI to include several tests (#4860) * Refs #20822: Split current job into different jobs Signed-off-by: JesusPoderoso * Refs #20822: Add shapes demo build job Signed-off-by: JesusPoderoso * Refs #20822: Add discovery server build test job Signed-off-by: JesusPoderoso * Refs #20822: Add python build test job Signed-off-by: JesusPoderoso * Refs #20822: Add documentation build test job Signed-off-by: JesusPoderoso * Refs #20822: Remove previous documentation workflow Signed-off-by: JesusPoderoso * Refs #20822: Avoid building with tests if not running tests Signed-off-by: JesusPoderoso * Refs #20822: Try to fix documentation job Signed-off-by: JesusPoderoso * Refs #20822: Move conditions to reusable workflows Signed-off-by: JesusPoderoso * Refs #20822: Apply internal review suggestions Signed-off-by: JesusPoderoso * Refs #20822: Refactor meta files into build and test, and combine them in test steps Signed-off-by: JesusPoderoso * Refs #20822: Remove matrix from ubuntu CI Signed-off-by: JesusPoderoso * Revert "Refs #20822: Move conditions to reusable workflows" This reverts commit d4eea0d7c642919d293ac0e7adf12831cc46dba7. * Refs #20822: Apply rev suggestions Signed-off-by: JesusPoderoso * Refs #20822: Add missing discovery server requirements in the job Signed-off-by: JesusPoderoso * Refs #20822: Apply rev suggestions (2) Signed-off-by: JesusPoderoso * Refs #20822: Fixing windows workflow by merging metas Signed-off-by: JesusPoderoso * Refs #20822: Add step with alternative builds Signed-off-by: JesusPoderoso * Refs #20822: Use colcon test meta in all jobs, and fix xfail filter Signed-off-by: JesusPoderoso * Refs #20822: Remove redundant CMake args, and fix alternative builds Signed-off-by: JesusPoderoso * Refs #20822: Apply rev suggestions (3) Signed-off-by: JesusPoderoso * Refs #20822: Explicitly compare boolean inputs Signed-off-by: eduponz * Refs #20822: Install tools on test steps to avoid losing symlink permissions Signed-off-by: eduponz * Refs #20822: Update discovery_server meta file name Signed-off-by: JesusPoderoso * Refs #20822: Adjust ternary operators Signed-off-by: JesusPoderoso * Refs #20822: Use CCache based on an input parameter Signed-off-by: JesusPoderoso --------- Signed-off-by: JesusPoderoso Signed-off-by: eduponz Co-authored-by: eduponz (cherry picked from commit 22338f3fcff604a2caa3dc2920ddb2db9b99eb25) # Conflicts: # .github/workflows/config/documentation.meta # .github/workflows/config/fastdds_build.meta # .github/workflows/documentation-tests.yaml # .github/workflows/nightly-ubuntu-ci.yml # .github/workflows/reusable-mac-ci.yml # .github/workflows/reusable-sanitizers-ci.yml # .github/workflows/reusable-ubuntu-ci.yml # .github/workflows/reusable-windows-ci.yml # .github/workflows/ubuntu-ci.yml --- .../config/{asan_colcon.meta => asan.meta} | 0 .../workflows/config/discovery_server.meta | 11 + .github/workflows/config/documentation.meta | 6 + .../config/{ci.meta => fastdds_build.meta} | 13 +- .github/workflows/config/fastdds_test.meta | 19 + .../config/{ci.repos => fastdds_test.repos} | 0 .github/workflows/config/python_test.meta | 15 + .../config/{tsan_colcon.meta => tsan.meta} | 0 .github/workflows/nightly-ubuntu-ci.yml | 102 +++ .github/workflows/reusable-mac-ci.yml | 14 +- .github/workflows/reusable-sanitizers-ci.yml | 67 +- .github/workflows/reusable-ubuntu-ci.yml | 662 +++++++++++++++++- .github/workflows/reusable-windows-ci.yml | 34 +- .github/workflows/sanitizers-ci.yml | 6 +- .github/workflows/ubuntu-ci.yml | 34 +- 15 files changed, 930 insertions(+), 53 deletions(-) rename .github/workflows/config/{asan_colcon.meta => asan.meta} (100%) create mode 100644 .github/workflows/config/discovery_server.meta rename .github/workflows/config/{ci.meta => fastdds_build.meta} (66%) create mode 100644 .github/workflows/config/fastdds_test.meta rename .github/workflows/config/{ci.repos => fastdds_test.repos} (100%) create mode 100644 .github/workflows/config/python_test.meta rename .github/workflows/config/{tsan_colcon.meta => tsan.meta} (100%) create mode 100644 .github/workflows/nightly-ubuntu-ci.yml diff --git a/.github/workflows/config/asan_colcon.meta b/.github/workflows/config/asan.meta similarity index 100% rename from .github/workflows/config/asan_colcon.meta rename to .github/workflows/config/asan.meta diff --git a/.github/workflows/config/discovery_server.meta b/.github/workflows/config/discovery_server.meta new file mode 100644 index 00000000000..066667461b8 --- /dev/null +++ b/.github/workflows/config/discovery_server.meta @@ -0,0 +1,11 @@ +names: + fastdds: + cmake-args: + - "-DCOMPILE_TOOLS=ON" + - "-DINSTALL_TOOLS=ON" + discovery-server: + ctest-args: [ + "--repeat", "until-pass:3", + "--timeout", "300", + "--label-exclude", "xfail" + ] diff --git a/.github/workflows/config/documentation.meta b/.github/workflows/config/documentation.meta index c0d85a3d55f..175d6b2c41f 100644 --- a/.github/workflows/config/documentation.meta +++ b/.github/workflows/config/documentation.meta @@ -1,4 +1,5 @@ names: +<<<<<<< HEAD fastrtps: cmake-args: - "-DBUILD_SHARED_LIBS=ON" @@ -6,10 +7,15 @@ names: - "-DTHIRDPARTY_Asio=FORCE" - "-DTHIRDPARTY_TinyXML2=FORCE" - "-DTHIRDPARTY_UPDATE=OFF" +======= +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) fastdds-docs: cmake-args: - "-DBUILD_DOCUMENTATION=ON" - "-DCOMPILE_TESTS=ON" + ctest-args: [ + "--timeout", "500" + ] googletest-distribution: cmake-args: - "-Dgtest_force_shared_crt=ON" diff --git a/.github/workflows/config/ci.meta b/.github/workflows/config/fastdds_build.meta similarity index 66% rename from .github/workflows/config/ci.meta rename to .github/workflows/config/fastdds_build.meta index 471c510dac4..0a75ca5dfe4 100644 --- a/.github/workflows/config/ci.meta +++ b/.github/workflows/config/fastdds_build.meta @@ -2,26 +2,27 @@ names: fastrtps: cmake-args: - "-DBUILD_DOCUMENTATION=OFF" - - "-DBUILD_SHARED_LIBS=ON" - "-DCOMPILE_EXAMPLES=ON" - - "-DEPROSIMA_BUILD_TESTS=ON" - "-DFASTDDS_ENFORCE_LOG_INFO=ON" +<<<<<<< HEAD:.github/workflows/config/ci.meta - "-DFASTDDS_PIM_API_TESTS=ON" - "-DFASTDDS_STATISTICS=ON" - "-DFASTRTPS_API_TESTS=OFF" +======= +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)):.github/workflows/config/fastdds_build.meta - "-DINSTALL_EXAMPLES=ON" - - "-DINSTALL_TOOLS=ON" - "-DINTERNAL_DEBUG=ON" - "-DNO_TLS=OFF" - - "-DPERFORMANCE_TESTS=ON" - - "-DPROFILING_TESTS=OFF" - "-DSHM_TRANSPORT_DEFAULT=ON" - "-DSTRICT_REALTIME=OFF" - - "-DSYSTEM_TESTS=ON" - "-DMEMORYCHECK_COMMAND_OPTIONS=-q --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=50 --log-fd=2 --error-exitcode=1" +<<<<<<< HEAD:.github/workflows/config/ci.meta - "-DMEMORYCHECK_SUPPRESSIONS_FILE=../../src/fastrtps/valgrind.supp" googletest-distribution: cmake-args: - "-Dgtest_force_shared_crt=ON" - "-DBUILD_SHARED_LIBS=ON" - "-DBUILD_GMOCK=ON" +======= + - "-DMEMORYCHECK_SUPPRESSIONS_FILE=../../src/fastdds/valgrind.supp" +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)):.github/workflows/config/fastdds_build.meta diff --git a/.github/workflows/config/fastdds_test.meta b/.github/workflows/config/fastdds_test.meta new file mode 100644 index 00000000000..07b12fc1788 --- /dev/null +++ b/.github/workflows/config/fastdds_test.meta @@ -0,0 +1,19 @@ +names: + fastdds: + cmake-args: + - "-DEPROSIMA_BUILD_TESTS=ON" + - "-DFASTDDS_PIM_API_TESTS=ON" + - "-DPERFORMANCE_TESTS=ON" + - "-DPROFILING_TESTS=OFF" + - "-DCOMPILE_TOOLS=ON" + - "-DSYSTEM_TESTS=ON" + ctest-args: [ + "--repeat", "until-pass:3", + "--timeout", "300", + "--label-exclude", "xfail" + ] + googletest-distribution: + cmake-args: + - "-Dgtest_force_shared_crt=ON" + - "-DBUILD_SHARED_LIBS=ON" + - "-DBUILD_GMOCK=ON" diff --git a/.github/workflows/config/ci.repos b/.github/workflows/config/fastdds_test.repos similarity index 100% rename from .github/workflows/config/ci.repos rename to .github/workflows/config/fastdds_test.repos diff --git a/.github/workflows/config/python_test.meta b/.github/workflows/config/python_test.meta new file mode 100644 index 00000000000..fc086118b84 --- /dev/null +++ b/.github/workflows/config/python_test.meta @@ -0,0 +1,15 @@ +names: + fastdds_python: + cmake-args: + - "-DBUILD_TESTING=ON" + - "-DBUILD_DOCUMENTATION=ON" + ctest-args: [ + "--repeat", "until-pass:3", + "--timeout", "300", + "--label-exclude", "xfail" + ] + googletest-distribution: + cmake-args: + - "-Dgtest_force_shared_crt=ON" + - "-DBUILD_SHARED_LIBS=ON" + - "-DBUILD_GMOCK=ON" diff --git a/.github/workflows/config/tsan_colcon.meta b/.github/workflows/config/tsan.meta similarity index 100% rename from .github/workflows/config/tsan_colcon.meta rename to .github/workflows/config/tsan.meta diff --git a/.github/workflows/nightly-ubuntu-ci.yml b/.github/workflows/nightly-ubuntu-ci.yml new file mode 100644 index 00000000000..5ef36ccac7c --- /dev/null +++ b/.github/workflows/nightly-ubuntu-ci.yml @@ -0,0 +1,102 @@ +name: Fast DDS Ubuntu CI (nightly) + +on: + workflow_dispatch: + schedule: + - cron: '0 1 * * *' + +jobs: + nightly-ubuntu-ci-master: + strategy: + fail-fast: false + matrix: + os-image: + - 'ubuntu-22.04' + security: + - true + - false + uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@master + with: + os-image: ${{ matrix.os-image }} + label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-master' + ctest-args: "-LE xfail" + fastdds-branch: 'master' + security: ${{ matrix.security }} + run-tests: true + use-ccache: true + + nightly-ubuntu-ci-2_14_x: + strategy: + fail-fast: false + matrix: + os-image: + - 'ubuntu-22.04' + security: + - true + - false + uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@2.14.x + with: + os-image: ${{ matrix.os-image }} + label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-2.14.x' + ctest-args: "-LE xfail" + fastdds-branch: '2.14.x' + security: ${{ matrix.security }} + run-tests: true + use-ccache: true + + nightly-ubuntu-ci-2_13_x: + strategy: + fail-fast: false + matrix: + os-image: + - 'ubuntu-22.04' + security: + - true + - false + uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@2.13.x + with: + os-image: ${{ matrix.os-image }} + label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-2.13.x' + ctest-args: "-LE xfail" + fastdds-branch: '2.13.x' + security: ${{ matrix.security }} + run-tests: true + use-ccache: true + + nightly-ubuntu-ci-2_10_x: + strategy: + fail-fast: false + matrix: + os-image: + - 'ubuntu-22.04' + security: + - true + - false + uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@2.10.x + with: + os-image: ${{ matrix.os-image }} + label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-2.10.x' + ctest-args: "-LE xfail" + fastdds-branch: '2.10.x' + security: ${{ matrix.security }} + run-tests: true + use-ccache: true + + nightly-ubuntu-ci-2_6_x: + strategy: + fail-fast: false + matrix: + os-image: + - 'ubuntu-22.04' + security: + - true + - false + uses: eProsima/Fast-DDS/.github/workflows/reusable-ubuntu-ci.yml@2.6.x + with: + os-image: ${{ matrix.os-image }} + label: '${{ matrix.os-image }}-nightly-sec-${{ matrix.security }}-ubuntu-ci-2.6.x' + ctest-args: "-LE xfail" + fastdds-branch: '2.6.x' + security: ${{ matrix.security }} + run-tests: true + use-ccache: true diff --git a/.github/workflows/reusable-mac-ci.yml b/.github/workflows/reusable-mac-ci.yml index 9fc226e41e6..55bed98abe3 100644 --- a/.github/workflows/reusable-mac-ci.yml +++ b/.github/workflows/reusable-mac-ci.yml @@ -37,7 +37,6 @@ jobs: # so we'll use that one for now, as clang 15 is the supported compiler for Fast DDS in macOS. # (see https://github.com/eProsima/Fast-DDS/blob/master/PLATFORM_SUPPORT.md#compilers) runs-on: macos-13 - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} strategy: fail-fast: false matrix: @@ -113,7 +112,11 @@ jobs: - name: Fetch Fast DDS CI dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: +<<<<<<< HEAD vcs_repos_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.repos +======= + vcs_repos_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_test.repos +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) destination_workspace: src skip_existing: 'true' @@ -125,7 +128,11 @@ jobs: continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: +<<<<<<< HEAD colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.meta +======= + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_test.meta +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) colcon_build_args: ${{ inputs.colcon-args }} cmake_args: ${{ inputs.cmake-args }} cmake_args_default: -DCMAKE_CXX_FLAGS="-Werror -Wall -Wno-enum-constexpr-conversion" @@ -137,11 +144,16 @@ jobs: if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') }} uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_test.meta colcon_test_args: ${{ inputs.colcon-args }} colcon_test_args_default: --event-handlers=console_direct+ ctest_args: ${{ inputs.ctest-args }} +<<<<<<< HEAD ctest_args_default: --repeat until-pass:3 --timeout 300 --label-exclude "xfail" packages_names: fastrtps +======= + packages_names: fastdds +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) workspace: ${{ github.workspace }} test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} diff --git a/.github/workflows/reusable-sanitizers-ci.yml b/.github/workflows/reusable-sanitizers-ci.yml index 22245fbeb75..2a03194f9e4 100644 --- a/.github/workflows/reusable-sanitizers-ci.yml +++ b/.github/workflows/reusable-sanitizers-ci.yml @@ -52,12 +52,7 @@ defaults: jobs: asan_fastdds_build: - if: ${{ ( - !contains(github.event.pull_request.labels.*.name, 'skip-ci') && - !contains(github.event.pull_request.labels.*.name, 'no-test') && - !contains(github.event.pull_request.labels.*.name, 'conflicts') && - (inputs.run_asan_fastdds == true) - ) }} + if: ${{ inputs.run_asan_fastdds == true }} runs-on: ubuntu-22.04 steps: - name: Add ci-pending label if PR @@ -114,13 +109,21 @@ jobs: - name: Show .meta file id: show_meta run: | +<<<<<<< HEAD cat ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan_colcon.meta +======= + cat ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan.meta +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) - name: Colcon build continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: +<<<<<<< HEAD colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan_colcon.meta +======= + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan.meta +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) colcon_build_args: ${{ inputs.colcon_build_args }} cmake_args: ${{ inputs.cmake_args }} cmake_args_default: '' @@ -182,13 +185,21 @@ jobs: - name: Show .meta file id: show_meta run: | +<<<<<<< HEAD cat ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan_colcon.meta +======= + cat ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan.meta +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) - name: Colcon build continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: +<<<<<<< HEAD colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan_colcon.meta +======= + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan.meta +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) colcon_build_args: ${{ inputs.colcon_build_args }} cmake_args: ${{ inputs.cmake_args }} cmake_args_default: -DEPROSIMA_BUILD_TESTS=ON -DRTPS_API_TESTS=ON -DFASTRTPS_API_TESTS=ON -DFASTDDS_PIM_API_TESTS=ON -DPERFORMANCE_TESTS=ON @@ -197,7 +208,7 @@ jobs: workspace_dependencies: '' - name: Colcon test - if: ${{ inputs.run_asan_fastdds }} + if: ${{ inputs.run_asan_fastdds == true }} id: test continue-on-error: true uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 @@ -212,7 +223,7 @@ jobs: test_report_artifact: ${{ format('test_report_{0}_{1}', inputs.label, github.job) }} - name: Report sanitizer errors - if: ${{ inputs.run_asan_fastdds }} + if: ${{ inputs.run_asan_fastdds == true }} run: | bash src/fastrtps/.github/workflows/utils/specific_errors_filter.sh \ "==ERROR:" \ @@ -226,12 +237,7 @@ jobs: --sanitizer asan asan_discovery_server_test: - if: ${{ ( - !contains(github.event.pull_request.labels.*.name, 'skip-ci') && - !contains(github.event.pull_request.labels.*.name, 'no-test') && - !contains(github.event.pull_request.labels.*.name, 'conflicts') && - (inputs.run_asan_discovery_server == true) - ) }} + if: ${{ inputs.run_asan_discovery_server == true }} needs: asan_fastdds_build runs-on: ubuntu-22.04 steps: @@ -281,13 +287,21 @@ jobs: - name: Show .meta file id: show_meta run: | +<<<<<<< HEAD cat ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan_colcon.meta +======= + cat ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan.meta +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) - name: Colcon build continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: +<<<<<<< HEAD colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/asan_colcon.meta +======= + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/asan.meta +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) colcon_build_args: ${{ inputs.colcon_build_args }} cmake_args: ${{ inputs.cmake_args }} cmake_args_default: '' @@ -296,7 +310,7 @@ jobs: workspace_dependencies: '' - name: Colcon test - if: ${{ inputs.run_asan_fastdds }} + if: ${{ inputs.run_asan_fastdds == true }} id: test continue-on-error: true uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 @@ -311,7 +325,7 @@ jobs: test_report_artifact: ${{ format('test_report_{0}_{1}', inputs.label, github.job) }} - name: Report sanitizer errors - if: ${{ inputs.run_asan_discovery_server }} + if: ${{ inputs.run_asan_discovery_server == true }} run: | bash src/fastrtps/.github/workflows/utils/specific_errors_filter.sh \ "==ERROR:" \ @@ -325,12 +339,7 @@ jobs: --sanitizer=asan tsan_fastdds_test: - if: ${{ ( - !contains(github.event.pull_request.labels.*.name, 'skip-ci') && - !contains(github.event.pull_request.labels.*.name, 'no-test') && - !contains(github.event.pull_request.labels.*.name, 'conflicts') && - (inputs.run_tsan_fastdds == true) - ) }} + if: ${{ inputs.run_tsan_fastdds == true }} runs-on: ubuntu-22.04 env: TSAN_OPTIONS: second_deadlock_stack=1 history_size=7 memory_limit_mb=5000 @@ -398,20 +407,32 @@ jobs: - name: Fetch Fast DDS CI dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: +<<<<<<< HEAD vcs_repos_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.repos +======= + vcs_repos_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_test.repos +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) destination_workspace: src skip_existing: 'true' - name: Show .meta file id: show_meta run: | +<<<<<<< HEAD cat ${{ github.workspace }}/src/fastrtps/.github/workflows/config/tsan_colcon.meta +======= + cat ${{ github.workspace }}/src/fastdds/.github/workflows/config/tsan.meta +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) - name: Colcon build continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: +<<<<<<< HEAD colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/tsan_colcon.meta +======= + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/tsan.meta +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) colcon_build_args: ${{ inputs.colcon_build_args }} cmake_args: ${{ inputs.cmake_args }} cmake_args_default: '' @@ -420,7 +441,7 @@ jobs: workspace_dependencies: '' - name: Colcon test - if: ${{ inputs.run_asan_fastdds }} + if: ${{ inputs.run_asan_fastdds == true }} id: test continue-on-error: true uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 diff --git a/.github/workflows/reusable-ubuntu-ci.yml b/.github/workflows/reusable-ubuntu-ci.yml index e9c064692a9..29907968224 100644 --- a/.github/workflows/reusable-ubuntu-ci.yml +++ b/.github/workflows/reusable-ubuntu-ci.yml @@ -27,15 +27,32 @@ on: description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)' required: true type: string + security: + description: 'Enable security features' + required: false + type: boolean + default: true + run-tests: + description: 'Run test suite of Fast DDS, Fast DDS python, and Fast DDS Discovery Server' + required: false + type: boolean + default: true + use-ccache: + description: 'Use CCache to speed up the build' + required: false + type: boolean + default: false +env: + security-cmake-flag: ${{ inputs.security == true && '-DSECURITY=ON' || '-DSECURITY=OFF' }} + colcon-build-default-cmake-args: '-DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-value -Woverloaded-virtual"' defaults: run: shell: bash jobs: - reusable-ubuntu-ci: + fastdds_build: runs-on: ${{ inputs.os-image }} - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} strategy: fail-fast: false matrix: @@ -84,6 +101,79 @@ jobs: - name: Setup CCache uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Fetch Fast DDS dependencies + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}/src/fastdds/fastdds.repos + destination_workspace: src + skip_existing: 'true' + + # Compiling Fast DDS tools has a problem with the symbolic link when the artifact is uploaded + # and downloaded, as it loses its permissions and then the tests fail. To work around this issue, + # we disable the compilation of the tools here and enable it in the Fast DDS test job. + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta + colcon_build_args: ${{ inputs.colcon-args }} + cmake_args: '-DCOMPILE_TOOLS=OFF ${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}' + cmake_args_default: ${{ env.colcon-build-default-cmake-args }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Upload build artifacts + uses: eProsima/eProsima-CI/external/upload-artifact@v0 + with: + name: fastdds_build_${{ inputs.label }} + path: ${{ github.workspace }} + + fastdds_test: + needs: fastdds_build + runs-on: ${{ inputs.os-image }} + if: ${{ inputs.run-tests == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Download build artifacts + uses: eProsima/eProsima-CI/external/download-artifact@v0 + with: + name: fastdds_build_${{ inputs.label }} + path: ${{ github.workspace }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install apt packages + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: libasio-dev libtinyxml2-dev libssl-dev + + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 + with: + packages: vcstool xmlschema + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} with: api_token: ${{ secrets.GITHUB_TOKEN }} @@ -102,20 +192,367 @@ jobs: # TODO(eduponz): Set up libp11 and SoftHSM. NOTE: using SoftHSM requires adding the runner to a group, # which entails logout/login or rebooting the machine. This is not feasible in a CI environment. - - name: Fetch Fast DDS dependencies + - name: Fetch Fast DDS CI dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: +<<<<<<< HEAD vcs_repos_file: ${{ github.workspace }}/src/fastrtps/fastrtps.repos +======= + vcs_repos_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_test.repos +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) destination_workspace: src skip_existing: 'true' + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_test.meta + colcon_build_args: ${{ inputs.colcon-args }} + cmake_args: '${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}' + cmake_args_default: '${{ env.colcon-build-default-cmake-args }} -DFASTDDS_EXAMPLE_TESTS=ON' + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Colcon test + id: test + uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_test.meta + colcon_test_args: ${{ inputs.colcon-args }} + colcon_test_args_default: --event-handlers=console_direct+ + ctest_args: ${{ inputs.ctest-args }} + packages_names: fastdds + workspace: ${{ github.workspace }} + test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} + + - name: Fast DDS test summary + uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 + if: ${{ !cancelled() }} + with: + junit_reports_dir: "${{ steps.test.outputs.ctest_results_path }}" + print_summary: 'True' + show_failed: 'True' + show_disabled: 'False' + show_skipped: 'False' + + fastdds_python_build: + needs: fastdds_build + runs-on: ${{ inputs.os-image }} + if: ${{ inputs.security == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Download build artifacts + uses: eProsima/eProsima-CI/external/download-artifact@v0 + with: + name: fastdds_build_${{ inputs.label }} + path: ${{ github.workspace }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install apt packages + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: libasio-dev libtinyxml2-dev libssl-dev swig + + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 + with: + packages: xmlschema + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Get Fast DDS Python branch + id: get_fastdds_python_branch + uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0 + with: + remote_repository: eProsima/Fast-DDS-python + fallback_branch: main + + - name: Download Fast DDS Python repo + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + repository: eProsima/Fast-DDS-python + path: src/fastdds-python + ref: ${{ steps.get_fastdds_python_branch.outputs.deduced_branch }} + + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta + colcon_build_args: ${{ inputs.colcon-args }} + cmake_args: '${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}' + cmake_args_default: '' + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Upload python build artifacts + uses: eProsima/eProsima-CI/external/upload-artifact@v0 + with: + name: fastdds_python_build_${{ inputs.label }} + path: ${{ github.workspace }} + + fastdds_python_test: + needs: fastdds_python_build + runs-on: ${{ inputs.os-image }} + if: ${{ inputs.security == true && inputs.run-tests == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Download python build artifacts + uses: eProsima/eProsima-CI/external/download-artifact@v0 + with: + name: fastdds_python_build_${{ inputs.label }} + path: ${{ github.workspace }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install apt packages + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: libasio-dev libtinyxml2-dev libssl-dev swig + + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 + with: + packages: vcstool xmlschema + - name: Fetch Fast DDS CI dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: +<<<<<<< HEAD vcs_repos_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.repos +======= + vcs_repos_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_test.repos +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) destination_workspace: src skip_existing: 'true' + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta ${{ github.workspace }}/src/fastdds/.github/workflows/config/python_test.meta + colcon_build_args: ${{ inputs.colcon-args }} + cmake_args: '${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}' + cmake_args_default: '' + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Colcon test + id: python_test + uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/python_test.meta + colcon_test_args: ${{ inputs.colcon-args }} + colcon_test_args_default: --event-handlers=console_direct+ + ctest_args: ${{ inputs.ctest-args }} + packages_names: fastdds_python + workspace: ${{ github.workspace }} + workspace_dependencies: '' + test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} + + - name: Fast DDS Python test summary + uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 + if: ${{ !cancelled() }} + with: + junit_reports_dir: "${{ steps.python_test.outputs.ctest_results_path }}" + print_summary: 'True' + show_failed: 'True' + show_disabled: 'False' + show_skipped: 'False' + + fastdds_docs_test: + needs: fastdds_python_build + runs-on: ${{ inputs.os-image }} + if: ${{ inputs.security == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Download python build artifacts + uses: eProsima/eProsima-CI/external/download-artifact@v0 + with: + name: fastdds_python_build_${{ inputs.label }} + path: ${{ github.workspace }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install apt packages + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: libasio-dev libtinyxml2-dev libssl-dev swig doxygen imagemagick plantuml + + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 + with: + packages: vcstool xmlschema + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Get Fast DDS Docs branch + id: get_fastdds_docs_branch + uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0 + with: + remote_repository: eProsima/Fast-DDS-docs + fallback_branch: master + + - name: Download Fast DDS documentation repo + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + repository: eProsima/Fast-DDS-docs + path: src/fastdds-docs + ref: ${{ steps.get_fastdds_docs_branch.outputs.deduced_branch }} + + - name: Fetch Fast DDS CI dependencies + if: ${{ inputs.run-tests == true }} + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_test.repos + destination_workspace: src + skip_existing: 'true' + + - name: Install Fast DDS Docs required python packages + uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 + with: + upgrade: false + requirements_file_name: src/fastdds-docs/docs/requirements.txt + + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta ${{ github.workspace }}/src/fastdds/.github/workflows/config/documentation.meta + colcon_build_args: ${{ inputs.colcon-args }} + cmake_args: '${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}' + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Colcon test + id: docs_test + if: ${{ inputs.run-tests == true }} + uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/documentation.meta + colcon_test_args: ${{ inputs.colcon-args }} + colcon_test_args_default: --event-handlers=console_direct+ + ctest_args: ${{ inputs.ctest-args }} + packages_names: fastdds-docs + workspace: ${{ github.workspace }} + workspace_dependencies: '' + test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} + + - name: Fast DDS Docs test summary + uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 + if: ${{ !cancelled() && inputs.run-tests == true }} + with: + junit_reports_dir: "${{ steps.docs_test.outputs.ctest_results_path }}" + print_summary: 'True' + show_failed: 'True' + show_disabled: 'False' + show_skipped: 'False' + + fastdds_shapesdemo_build: + needs: fastdds_build + runs-on: ${{ inputs.os-image }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Download build artifacts + uses: eProsima/eProsima-CI/external/download-artifact@v0 + with: + name: fastdds_build_${{ inputs.label }} + path: ${{ github.workspace }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install apt packages + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: libasio-dev libtinyxml2-dev libssl-dev + + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 + with: + packages: xmlschema + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + # Get Shapes Demo to make sure it keeps compiling - name: Get Shapes Demo branch id: get_shapes_demo_branch @@ -146,32 +583,237 @@ jobs: continue-on-error: false uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: +<<<<<<< HEAD colcon_meta_file: ${{ github.workspace }}/src/fastrtps/.github/workflows/config/ci.meta +======= + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) colcon_build_args: ${{ inputs.colcon-args }} - cmake_args: ${{ inputs.cmake-args }} - cmake_args_default: -DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-value -Woverloaded-virtual" -DFASTDDS_EXAMPLE_TESTS=ON + cmake_args: '${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}' + cmake_args_default: ${{ env.colcon-build-default-cmake-args }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + fastdds_discovery_server_test: + needs: fastdds_build + runs-on: ${{ inputs.os-image }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Download build artifacts + uses: eProsima/eProsima-CI/external/download-artifact@v0 + with: + name: fastdds_build_${{ inputs.label }} + path: ${{ github.workspace }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install apt packages + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: libasio-dev libtinyxml2-dev libssl-dev + + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 + with: + packages: vcstool xmlschema xmltodict==0.13.0 jsondiff==2.0.0 pandas==1.5.2 + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Get Discovery Server branch + id: get_discovery_server_branch + uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0 + with: + remote_repository: eProsima/Discovery-Server + fallback_branch: 'master' + + - name: Download Discovery Server repo + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + repository: eProsima/Discovery-Server + path: src/discovery_server + ref: ${{ steps.get_discovery_server_branch.outputs.deduced_branch }} + + - name: Fetch Fast DDS CI dependencies + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_test.repos + destination_workspace: src + skip_existing: 'true' + + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta ${{ github.workspace }}/src/fastdds/.github/workflows/config/discovery_server.meta + colcon_build_args: ${{ inputs.colcon-args }} + cmake_args: '${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}' + cmake_args_default: ${{ env.colcon-build-default-cmake-args }} cmake_build_type: ${{ matrix.cmake-build-type }} workspace: ${{ github.workspace }} - name: Colcon test - id: test - if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') }} + id: discovery_server_test + if: ${{ inputs.run-tests == true }} uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/discovery_server.meta colcon_test_args: ${{ inputs.colcon-args }} colcon_test_args_default: --event-handlers=console_direct+ ctest_args: ${{ inputs.ctest-args }} +<<<<<<< HEAD ctest_args_default: --repeat until-pass:3 --timeout 300 --label-exclude "xfail" packages_names: fastrtps +======= + packages_names: discovery-server +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) workspace: ${{ github.workspace }} + workspace_dependencies: '' test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} - - name: Test summary + - name: Discovery server test summary uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 - if: ${{ !cancelled() && !contains(github.event.pull_request.labels.*.name, 'no-test') }} + if: ${{ !cancelled() && inputs.run-tests == true }} with: - junit_reports_dir: "${{ steps.test.outputs.ctest_results_path }}" + junit_reports_dir: "${{ steps.discovery_server_test.outputs.ctest_results_path }}" print_summary: 'True' show_failed: 'True' show_disabled: 'False' show_skipped: 'False' + + fastdds_alternative_builds: + runs-on: ${{ inputs.os-image }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Sync eProsima/Fast-DDS repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: src/fastdds + ref: ${{ inputs.fastdds-branch }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install apt dependencies + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: libasio-dev libtinyxml2-dev libssl-dev + update: false + upgrade: false + + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 + with: + packages: vcstool xmlschema + upgrade: false + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Fetch Fast DDS dependencies + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}/src/fastdds/fastdds.repos + destination_workspace: src + skip_existing: 'true' + + - name: No security colcon build + continue-on-error: true + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta + colcon_build_args: ${{ inputs.colcon-args }} + cmake_args: '-DSECURITY=OFF ${{ inputs.cmake-args }}' + cmake_args_default: ${{ env.colcon-build-default-cmake-args }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Clean workspace - No security + if: ${{ always() }} + run: | + cd ${{ github.workspace }} + rm -rf build install log + + - name: No statistics colcon build + continue-on-error: true + if: ${{ always() }} + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta + colcon_build_args: ${{ inputs.colcon-args }} + cmake_args: '-DFASTDDS_STATISTICS=OFF ${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}' + cmake_args_default: ${{ env.colcon-build-default-cmake-args }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Clean workspace - No statistics + if: ${{ always() }} + run: | + cd ${{ github.workspace }} + rm -rf build install log + + # No .metas file, so FASTDDS_ENFORCE_LOG_INFO is set OFF by default. Missed important args are manually included + - name: No enforcing log info colcon build + continue-on-error: true + if: ${{ always() }} + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: '' + colcon_build_args: ${{ inputs.colcon-args }} + cmake_args: '-DCOMPILE_EXAMPLES=ON ${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}' + cmake_args_default: ${{ env.colcon-build-default-cmake-args }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Clean workspace - No enforce log info + if: ${{ always() }} + run: | + cd ${{ github.workspace }} + rm -rf build install log + + - name: No shared libs colcon build + continue-on-error: true + if: ${{ always() }} + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds/.github/workflows/config/fastdds_build.meta + colcon_build_args: ${{ inputs.colcon-args }} + cmake_args: '-DBUILD_SHARED_LIBS=OFF ${{ env.security-cmake-flag }} ${{ inputs.cmake-args }}' + cmake_args_default: ${{ env.colcon-build-default-cmake-args }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} diff --git a/.github/workflows/reusable-windows-ci.yml b/.github/workflows/reusable-windows-ci.yml index 046f6389df4..58677b59cc3 100644 --- a/.github/workflows/reusable-windows-ci.yml +++ b/.github/workflows/reusable-windows-ci.yml @@ -31,7 +31,6 @@ defaults: jobs: reusable-windows-ci: runs-on: windows-2019 - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} strategy: fail-fast: false matrix: @@ -138,18 +137,44 @@ jobs: - name: Fetch Fast DDS CI dependencies uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 with: +<<<<<<< HEAD vcs_repos_file: ${{ github.workspace }}\src\fastrtps\.github\workflows\config\ci.repos +======= + vcs_repos_file: ${{ github.workspace }}\src\fastdds\.github\workflows\config\fastdds_test.repos +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) destination_workspace: src skip_existing: 'true' + - name: Prepare build meta file + run: | + $build_meta_file = '${{ github.workspace }}\src\fastdds\.github\workflows\config\fastdds_build.meta' + $test_meta_file = '${{ github.workspace }}\src\fastdds\.github\workflows\config\fastdds_test.meta' + $build_test_meta_file = '${{ github.workspace }}\src\fastdds\.github\workflows\config\fastdds_build_test.meta' + + # Read the content of the build meta file + $build_meta_content = Get-Content -Path $build_meta_file + + # Read the content of the test meta file, starting from line 4 (skipping "name" line [1], cmake project name line [2] and "cmake-args" line [3]) + $test_meta_content = Get-Content -Path $test_meta_file | Select-Object -Skip 3 + + # Combine the content of the build meta file and the test meta file + $combined_content = $build_meta_content + $test_meta_content + + # Write the combined content to the build test meta file + $combined_content | Out-File -FilePath $build_test_meta_file -Encoding UTF8 + - name: Build id: build continue-on-error: false uses: eProsima/eProsima-CI/windows/colcon_build@v0 with: +<<<<<<< HEAD colcon_meta_file: ${{ github.workspace }}\src\fastrtps\.github\workflows\config\ci.meta +======= + colcon_meta_file: ${{ github.workspace }}\src\fastdds\.github\workflows\config\fastdds_build_test.meta +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) colcon_build_args: ${{ inputs.colcon-args }} - # The following Fast DDS CMake options need to be specified here instead of in the ci.meta file + # The following Fast DDS CMake options need to be specified here instead of in the meta files # because they vary from platform to platform cmake_args_default: ${{ inputs.cmake-args }} -T ${{ matrix.vs-toolset }} -DTHIRDPARTY_Asio=FORCE -DTHIRDPARTY_TinyXML2=FORCE -DTHIRDPARTY_fastcdr=OFF -DTHIRDPARTY_UPDATE=ON -DEPROSIMA_EXTRA_CMAKE_CXX_FLAGS="/MP /WX" cmake_build_type: ${{ matrix.cmake-config }} @@ -160,11 +185,16 @@ jobs: id: test uses: eProsima/eProsima-CI/windows/colcon_test@v0 with: + colcon_meta_file: ${{ github.workspace }}\src\fastdds\.github\workflows\config\fastdds_test.meta colcon_test_args: ${{ inputs.colcon-args }} colcon_test_args_default: --event-handlers=console_direct+ ctest_args: ${{ inputs.ctest-args }} +<<<<<<< HEAD ctest_args_default: --repeat until-pass:3 --timeout 300 --label-exclude "xfail" packages_names: fastrtps +======= + packages_names: fastdds +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860)) workspace: ${{ github.workspace }} test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} diff --git a/.github/workflows/sanitizers-ci.yml b/.github/workflows/sanitizers-ci.yml index 13df44dd0f0..85f4ac59246 100644 --- a/.github/workflows/sanitizers-ci.yml +++ b/.github/workflows/sanitizers-ci.yml @@ -66,9 +66,9 @@ jobs: uses: ./.github/workflows/reusable-sanitizers-ci.yml with: label: ${{ inputs.label || 'fastdds-sanitizers-ci' }} - run_asan_fastdds: ${{ inputs.run_asan_fastdds || github.event_name == 'pull_request' }} - run_asan_discovery_server: ${{ inputs.run_asan_discovery_server || github.event_name == 'pull_request' }} - run_tsan_fastdds: ${{ inputs.run_tsan_fastdds || github.event_name == 'pull_request' }} + run_asan_fastdds: ${{ ((inputs.run_asan_fastdds == true) && true) || github.event_name == 'pull_request' }} + run_asan_discovery_server: ${{ ((inputs.run_asan_discovery_server == true) && true) || github.event_name == 'pull_request' }} + run_tsan_fastdds: ${{ ((inputs.run_tsan_fastdds == true) && true) || github.event_name == 'pull_request' }} colcon_build_args: ${{ inputs.colcon_build_args || '' }} colcon_test_args: ${{ inputs.colcon_test_args || '' }} cmake_args: ${{ inputs.cmake_args || '' }} diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index 7aa372d3c52..6733e5c05e1 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -23,6 +23,21 @@ on: description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)' type: string required: true + security: + description: 'Enable security features' + required: false + type: boolean + default: true + run-tests: + description: 'Run suite of tests of Fast DDS, Fast DDS python, and Fast DDS Discovery Server' + required: false + type: boolean + default: true + use-ccache: + description: 'Use CCache to speed up the build' + required: false + type: boolean + default: false pull_request: types: @@ -39,21 +54,24 @@ concurrency: jobs: ubuntu-ci: - strategy: - fail-fast: false - matrix: - os-image: - - 'ubuntu-22.04' - if: ${{ ( !contains(github.event.pull_request.labels.*.name, 'skip-ci') && !contains(github.event.pull_request.labels.*.name, 'conflicts') ) }} uses: ./.github/workflows/reusable-ubuntu-ci.yml with: - os-image: ${{ matrix.os-image }} + # It would be desirable to have a matrix of ubuntu OS for this job, but due to the issue opened in this ticket: + # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. + os-image: 'ubuntu-22.04' label: ${{ inputs.label || 'ubuntu-ci' }} colcon-args: ${{ inputs.colcon-args }} - cmake-args: '-DSECURITY=ON ${{ inputs.cmake-args }}' + cmake-args: ${{ inputs.cmake-args }} ctest-args: ${{ inputs.ctest-args || '-LE xfail' }} +<<<<<<< HEAD fastdds-branch: ${{ inputs.fastdds_branch || github.ref || '2.14.x' }} +======= + fastdds-branch: ${{ inputs.fastdds_branch || github.ref || 'master' }} + security: ${{ ((inputs.security == true) && true) || github.event_name == 'pull_request' }} + run-tests: ${{ ((inputs.run-tests == true) && true) || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'no-test')) }} + use-ccache: ${{ ((inputs.use-ccache == true) && true) || false }} +>>>>>>> 22338f3fc (Refactor Fast DDS Ubuntu CI to include several tests (#4860))