From 5fac547f0f23194a3d8e7d639957c282503a8398 Mon Sep 17 00:00:00 2001 From: Raul Sanchez-Mateos Date: Mon, 13 May 2024 16:36:23 +0200 Subject: [PATCH] Support multiple versions of Fast DDS in CI Signed-off-by: Raul Sanchez-Mateos --- .../actions/project_dependencies/action.yml | 9 +- .github/docker/ddsrouter/Dockerfile | 2 +- .github/docker/vulcanexus/Dockerfile | 2 +- ..._test.yml => docker-reusable-workflow.yml} | 67 ++-- .github/workflows/nightly.yml | 53 +++ .github/workflows/reusable-workflow.yml | 352 ++++++++++++++++++ .github/workflows/test.yml | 335 ++--------------- 7 files changed, 460 insertions(+), 360 deletions(-) rename .github/workflows/{docker_test.yml => docker-reusable-workflow.yml} (63%) create mode 100644 .github/workflows/nightly.yml create mode 100644 .github/workflows/reusable-workflow.yml diff --git a/.github/actions/project_dependencies/action.yml b/.github/actions/project_dependencies/action.yml index f1cffc74d..03b3555db 100644 --- a/.github/actions/project_dependencies/action.yml +++ b/.github/actions/project_dependencies/action.yml @@ -11,6 +11,13 @@ inputs: description: Specify cmake_build_type option to download specific artifact required: true + custom_version_build: + description: > + Use the custom version build from eProsima-CI. + If set to false, the workflow will run the tests for Fast DDS v2 and v3. + required: true + default: 'custom' + dependencies_artifact_postfix: description: Specify artifact postfix in case it wants to use a manual one required: false @@ -47,7 +54,7 @@ runs: - name: Download dependencies artifact uses: eProsima/eProsima-CI/multiplatform/download_dependency@v0 with: - artifact_name: built_ddspipe_${{ inputs.os }}_${{ inputs.cmake_build_type }}${{ inputs.dependencies_artifact_postfix }} + artifact_name: built_ddspipe_${{ inputs.custom_version_build }}_${{ inputs.os }}_${{ inputs.cmake_build_type }}${{ inputs.dependencies_artifact_postfix }} workflow_source: build_ddspipe.yml workflow_source_repository: eProsima/eProsima-CI target_workspace: ${{ inputs.target_workspace }} diff --git a/.github/docker/ddsrouter/Dockerfile b/.github/docker/ddsrouter/Dockerfile index 5464d7a20..1aa35a16a 100644 --- a/.github/docker/ddsrouter/Dockerfile +++ b/.github/docker/ddsrouter/Dockerfile @@ -43,7 +43,7 @@ WORKDIR /ddsrouter ARG fastcdr_branch=master -ARG fastdds_branch=master +ARG fastdds_branch=2.x ARG devutils_branch=main ARG ddspipe_branch=main ARG ddsrouter_branch=main diff --git a/.github/docker/vulcanexus/Dockerfile b/.github/docker/vulcanexus/Dockerfile index 1977587b1..60fc91ca3 100644 --- a/.github/docker/vulcanexus/Dockerfile +++ b/.github/docker/vulcanexus/Dockerfile @@ -1,7 +1,7 @@ ARG docker_image_base FROM $docker_image_base -LABEL author=javierparis@eprosima.com +LABEL author=raul@eprosima.com # Avoid interactuation with installation of some package that needs the locale. ENV TZ=Europe/Madrid diff --git a/.github/workflows/docker_test.yml b/.github/workflows/docker-reusable-workflow.yml similarity index 63% rename from .github/workflows/docker_test.yml rename to .github/workflows/docker-reusable-workflow.yml index 0334ec165..6419e1e20 100644 --- a/.github/workflows/docker_test.yml +++ b/.github/workflows/docker-reusable-workflow.yml @@ -1,43 +1,48 @@ -name: ddsrouter-docker-tests +name: docker-reusable-workflow on: - workflow_dispatch: + workflow_call: inputs: + fastcdr_branch: description: 'Branch or tag of Fast CDR repository (https://github.com/eProsima/Fast-CDR)' required: true default: 'master' + type: string + fastdds_branch: description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)' required: true default: 'master' - devutils_branch: - description: 'Branch or tag of dev-utils repository (https://github.com/eProsima/dev-utils)' - required: true - default: 'main' + type: string + ddspipe_branch: description: 'Branch or tag of DDS Pipe repository (https://github.com/eProsima/DDS-Pipe)' required: true default: 'main' + type: string + ddsrouter_branch: description: 'Branch or tag of DDS Router repository (https://github.com/eProsima/DDS-Router)' required: true default: 'main' + type: string + + custom_version_build: + description: > + Version of Fast DDS build from eProsima-CI. + required: true + type: string + dependencies_artifact_postfix: description: 'Postfix name to add to artifact name to download dependencies. This is use to download a specific artifact version from eProsima-CI.' required: true default: '_nightly' - pull_request: - push: - branches: - - main - schedule: - - cron: '0 0 * * *' + type: string env: code_packages_names: 'ddsrouter_test' docs_packages_names: '' - default_dependencies_artifact_postfix: '_nightly' jobs: docker-test: @@ -45,11 +50,6 @@ jobs: runs-on: ubuntu-22.04 env: - DEFAULT_FASTCDR_BRANCH: 'master' - DEFAULT_FASTDDS_BRANCH: 'master' - DEFAULT_DEVUTILS_BRANCH: 'main' - DEFAULT_DDSPIPE_BRANCH: 'main' - DEFAULT_DDSROUTER_BRANCH: 'main' DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE: "ddsrouter:ci" DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE: "vulcanexus:ci" @@ -60,24 +60,6 @@ jobs: with: path: ${{ github.workspace }}/src - # Echo Env Var to debug workflow - - name: Echo env variables - run: | - echo "--- Input Variables ---" - echo "github.event.inputs.fastcdr_branch: ${{ github.event.inputs.fastcdr_branch }}" - echo "github.event.inputs.fastdds_branch: ${{ github.event.inputs.fastdds_branch }}" - echo "github.event.inputs.devutils_branch: ${{ github.event.inputs.devutils_branch }}" - echo "github.event.inputs.ddspipe_branch: ${{ github.event.inputs.ddspipe_branch }}" - echo "github.event.inputs.ddsrouter_branch: ${{ github.event.inputs.ddsrouter_branch }}" - echo "--- Github Environment Variables ---" - echo "github.head_ref: ${{ github.head_ref }}" - echo "--- Environment Variables ---" - echo "DEFAULT_FASTCDR_BRANCH: ${{ env.DEFAULT_FASTCDR_BRANCH }}" - echo "DEFAULT_FASTDDS_BRANCH: ${{ env.DEFAULT_FASTDDS_BRANCH }}" - echo "DEFAULT_DEVUTILS_BRANCH: ${{ env.DEFAULT_DEVUTILS_BRANCH }}" - echo "DEFAULT_DDSPIPE_BRANCH: ${{ env.DEFAULT_DDSPIPE_BRANCH }}" - echo "DEFAULT_DDSROUTER_BRANCH: ${{ env.DEFAULT_DDSROUTER_BRANCH }}" - # Build Vulcanexus Docker image - name: Build custom Vulcanexus Docker image run: | @@ -94,14 +76,12 @@ jobs: cd ./src/.github/docker/ddsrouter docker build \ --no-cache \ - --build-arg fastcdr_branch=${{ github.event.inputs.fastcdr_branch || env.DEFAULT_FASTCDR_BRANCH }} \ - --build-arg fastdds_branch=${{ github.event.inputs.fastdds_branch || env.DEFAULT_FASTDDS_BRANCH }} \ - --build-arg devutils_branch=${{ github.event.inputs.devutils_branch || env.DEFAULT_DEVUTILS_BRANCH }} \ - --build-arg ddspipe_branch=${{ github.event.inputs.ddspipe_branch || env.DEFAULT_DDSPIPE_BRANCH }} \ - --build-arg ddsrouter_branch=${{ github.event.inputs.ddsrouter_branch || github.head_ref || env.DEFAULT_DDSROUTER_BRANCH }} \ + --build-arg fastcdr_branch=${{ inputs.fastcdr_branch }} \ + --build-arg fastdds_branch=${{ inputs.fastdds_branch }} \ + --build-arg ddspipe_branch=${{ inputs.ddspipe_branch }} \ + --build-arg ddsrouter_branch=${{ inputs.ddsrouter_branch }} \ -t ${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }} \ -f Dockerfile . - echo "DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE: ${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }}" # Check Docker images exist - name: Check if Docker images exist @@ -114,7 +94,8 @@ jobs: with: os: ubuntu-22.04 cmake_build_type: "Release" - dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }} + custom_version_build: ${{ inputs.custom_version_build }} + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }} secret_token: ${{ secrets.GITHUB_TOKEN }} - name: Compile docker tests diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..a1e3ed58d --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,53 @@ +# Nightly test workflow for DDS Router +name: nightly + +on: + schedule: + - cron: '0 5 * * *' + +jobs: + + reusable_tests_v2: + name: reusable_tests_v2 + uses: ./.github/workflows/reusable-workflow.yml + with: + custom_version_build: 'v2' + dependencies_artifact_postfix: '_nightly' + secrets: inherit + + # Uncomment this block to run the tests for Fast DDS v3 when DDS Router is updated + # Also specify here (and above) the workflow version/branch to use (@v0, @main, etc.) + # reusable_tests_v3: + # name: reusable_tests_v3 + # uses: ./.github/workflows/reusable-workflow.yml + # with: + # custom_version_build: 'v3' + # dependencies_artifact_postfix: '_nightly' + # secrets: inherit + + reusable_docker_tests_v2: + name: reusable_docker_tests_v2 + uses: ./.github/workflows/docker-reusable-workflow.yml + with: + fastcdr_branch: 'master' + fastdds_branch: '2.x' + ddspipe_branch: 'main' + ddsrouter_branch: 'main' + custom_version_build: 'v2' + dependencies_artifact_postfix: '_nightly' + secrets: inherit + + # Uncomment this block to run the tests for Fast DDS v3 when DDS Router is updated + # Also specify here (and above) the workflow version/branch to use (@v0, @main, etc.) + # reusable_docker_tests_v3: + # name: reusable_docker_tests_v3 + # uses: ./.github/workflows/docker-reusable-workflow.yml + # with: + # fastcdr_branch: 'master' + # fastdds_branch: '3.x' + # ddspipe_branch: 'main' + # ddsrouter_branch: 'main' + # custom_version_build: 'v3' + # dependencies_artifact_postfix: '_nightly' + # secrets: inherit + diff --git a/.github/workflows/reusable-workflow.yml b/.github/workflows/reusable-workflow.yml new file mode 100644 index 000000000..d61d5ad74 --- /dev/null +++ b/.github/workflows/reusable-workflow.yml @@ -0,0 +1,352 @@ +# Reusable workflow to run the following jobs: +# +# - multiplatform-tests +# - [ ubuntu-22.04 | ubuntu-20.04 | windows-2019 | windows-2022 ] +# - [ Debug | Release ] +# - execute tests in different versions of ubuntu with different build types +# +# - asan +# - ubuntu-22.04 +# - execute tests with ASAN flag +# +# - tsan +# - ubuntu-22.04 +# - execute tests with TSAN flag +# +# - clang +# - ubuntu-22.04 +# - execute clang-tidy check +# +# - coverage +# - ubuntu-22.04 +# - execute test with coverage flag and upload results +# +# - flaky +# - ubuntu-22.04 +# - execute flaky tests +# +# - docs +# - ubuntu-22.04 +# - execute docs compile and tests +# +# - uncrustify +# - ubuntu-22.04 +# - test uncrustify +# +# - python-linter +# - ubuntu-22.04 +# - test python linter +# + +name: reusable-workflow + +on: + + workflow_call: + inputs: + + fastcdr_branch: + description: 'Branch or tag of Fast CDR repository (https://github.com/eProsima/Fast-CDR)' + required: true + default: 'master' + type: string + + fastdds_branch: + description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)' + required: true + default: 'master' + type: string + + ddspipe_branch: + description: 'Branch or tag of DDS Pipe repository (https://github.com/eProsima/DDS-Pipe)' + required: true + default: 'main' + type: string + + ddsrouter_branch: + description: 'Branch or tag of DDS Router repository (https://github.com/eProsima/DDS-Router)' + required: true + default: 'main' + type: string + + custom_version_build: + description: > + Version of Fast DDS build from eProsima-CI. + required: true + type: string + + dependencies_artifact_postfix: + description: > + Postfix name to add to artifact name to download dependencies. + This is use to download a specific artifact version from eProsima-CI. + required: true + default: '_nightly' + type: string + +env: + code_packages_names: 'ddsrouter_core ddsrouter_yaml ddsrouter_tool' + docs_packages_names: 'ddsrouter_docs' + +jobs: + +##################################################################### +# TEST + + multiplatform-tests: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + cmake_build_type: + - Release + - Debug + os: + - ubuntu-20.04 + - ubuntu-22.04 + - windows-2019 + - windows-2022 + + steps: + + - name: Sync repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: ${{ github.workspace }}/src + + - name: Download dependencies and install requirements + uses: ./src/.github/actions/project_dependencies + with: + os: ${{ matrix.os }} + cmake_build_type: ${{ matrix.cmake_build_type }} + custom_version_build: ${{ inputs.custom_version_build }} + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }} + secret_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Compile and run tests + id: compile_and_test + uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@main + with: + packages_names: ${{ env.code_packages_names }} + cmake_args: -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} + workspace_dependencies: ${{ github.workspace }}/install + ctest_args: --label-exclude "xfail" + colcon_meta_file: ${{ github.workspace }}/src/.github/workflows/configurations/${{ runner.os }}/colcon.meta + + - name: Test Report + uses: eProsima/eProsima-CI/external/test-reporter@main + if: success() || failure() + with: + name: "Report: ${{ matrix.os }} | ${{ matrix.cmake_build_type }} " + path: "${{ steps.compile_and_test.outputs.ctest_results_path }}*.xml" + working-directory: 'src' + path-replace-backslashes: 'true' + list-tests: 'failed' + +##################################################################### +# ASAN + + asan: + runs-on: ubuntu-22.04 + steps: + + - name: Sync repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: ${{ github.workspace }}/src + + - name: Download dependencies and install requirements + uses: ./src/.github/actions/project_dependencies + with: + os: ubuntu-22.04 + cmake_build_type: Release + custom_version_build: ${{ inputs.custom_version_build }} + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }} + secret_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Compile and run tests + id: compile_and_test + uses: eProsima/eProsima-CI/multiplatform/asan_build_test@main + with: + packages_names: ${{ env.code_packages_names }} + workspace_dependencies: ${{ github.workspace }}/install + + - name: Test Report + uses: eProsima/eProsima-CI/external/test-reporter@main + if: success() || failure() + with: + name: "Report: ASAN " + path: "${{ steps.compile_and_test.outputs.ctest_results_path }}*.xml" + working-directory: 'src' + list-tests: 'failed' + +##################################################################### +# TSAN + + tsan: + runs-on: ubuntu-22.04 + steps: + + - name: Sync repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: ${{ github.workspace }}/src + + - name: Download dependencies and install requirements + uses: ./src/.github/actions/project_dependencies + with: + os: ubuntu-22.04 + cmake_build_type: Release + custom_version_build: ${{ inputs.custom_version_build }} + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }} + secret_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Compile and run tests + id: compile_and_test + uses: eProsima/eProsima-CI/multiplatform/tsan_build_test@main + with: + packages_names: ${{ env.code_packages_names }} + workspace_dependencies: ${{ github.workspace }}/install + + - name: Test Report + uses: eProsima/eProsima-CI/external/test-reporter@main + if: success() || failure() + with: + name: "Report: TSAN " + path: "${{ steps.compile_and_test.outputs.ctest_results_path }}*.xml" + working-directory: 'src' + list-tests: 'failed' + +##################################################################### +# CLANG + + clang: + runs-on: ubuntu-22.04 + steps: + + - name: Sync repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: ${{ github.workspace }}/src + + - name: Download dependencies and install requirements + uses: ./src/.github/actions/project_dependencies + with: + os: ubuntu-22.04 + cmake_build_type: Release + custom_version_build: ${{ inputs.custom_version_build }} + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }} + secret_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Compile and run tests + uses: eProsima/eProsima-CI/multiplatform/clang_build_test@v0 + with: + packages_names: ${{ env.code_packages_names }} + workspace_dependencies: ${{ github.workspace }}/install + + +##################################################################### +# COVERAGE + + coverage: + runs-on: ubuntu-22.04 + environment: + name: codecov + steps: + + - name: Sync repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: ${{ github.workspace }}/src + + - name: Download dependencies and install requirements + uses: ./src/.github/actions/project_dependencies + with: + os: ubuntu-22.04 + cmake_build_type: Release + custom_version_build: ${{ inputs.custom_version_build }} + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }} + secret_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Compile and run tests + uses: eProsima/eProsima-CI/ubuntu/coverage_build_test_upload@main + with: + packages_names: ${{ env.code_packages_names }} + workspace_dependencies: ${{ github.workspace }}/install + codecov_token: ${{ secrets.CODECOV_TOKEN }} + codecov_fix_file_path: ${{ github.workspace }}/src/codecov.yml + + +##################################################################### +# FLAKY + + flaky: + runs-on: ubuntu-22.04 + steps: + + - name: Sync repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: ${{ github.workspace }}/src + + - name: Download dependencies and install requirements + uses: ./src/.github/actions/project_dependencies + with: + os: ubuntu-22.04 + cmake_build_type: Release + custom_version_build: ${{ inputs.custom_version_build }} + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }} + secret_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Compile and run tests + id: compile_and_test + uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@main + with: + packages_names: ${{ env.code_packages_names }} + workspace_dependencies: ${{ github.workspace }}/install + ctest_args: --label-regex "xfail" + + - name: Test Report + uses: eProsima/eProsima-CI/external/test-reporter@main + if: success() || failure() + with: + name: "Report: Flaky " + path: "${{ steps.compile_and_test.outputs.ctest_results_path }}*.xml" + working-directory: 'src' + fail-on-empty: 'false' + list-tests: 'failed' + +##################################################################### +# DOCUMENTATION TEST + + docs: + runs-on: ubuntu-22.04 + steps: + - name: Build and test documentation + uses: eProsima/eProsima-CI/ubuntu/sphinx_docs@main + with: + checkout_path: "${{ github.workspace }}/src/ddsrouter" + path_to_requirements: "${{ github.workspace }}/src/ddsrouter/docs/requirements.txt" + docs_subpackage_name: ${{ env.docs_packages_names }} + secret_token: ${{ secrets.GITHUB_TOKEN }} + + +##################################################################### +# UNCRUSTIFY + + uncrustify: + runs-on: ubuntu-22.04 + steps: + + - name: Uncrustify + uses: eProsima/eProsima-CI/ubuntu/uncrustify@v0 + + +##################################################################### +# PYTHON LINTER + + python-linter: + runs-on: ubuntu-22.04 + steps: + + - name: Python Linter + uses: eProsima/eProsima-CI/ubuntu/python_linter@v0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index afc281ad7..3c1fecfe6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,59 +1,22 @@ - # Main CI -# This is executed: -# - every PullRequest (new or update) -# - every merge in main -# - every night (05:00) -# -# These jobs that require to install eprosima libraries uses the artifact generated for eprosima-CI nightly -# so they do not have to compile the whole project. This saves huge amount of time. -# -# JOBS: -# -# - multiplatform-tests -# - [ ubuntu-22.04 | ubuntu-20.04 | windows-2019 | windows-2022 ] -# - [ Debug | Release ] -# - execute tests in different versions of ubuntu with different build types -# -# - asan -# - ubuntu-22.04 -# - execute tests with ASAN flag -# -# - tsan -# - ubuntu-22.04 -# - execute tests with TSAN flag -# -# - clang -# - ubuntu-22.04 -# - execute clang-tidy check -# -# - coverage -# - ubuntu-22.04 -# - execute test with coverage flag and upload results -# -# - flaky -# - ubuntu-22.04 -# - execute flaky tests -# -# - docs -# - ubuntu-22.04 -# - execute docs compile and tests -# -# - uncrustify -# - ubuntu-22.04 -# - test uncrustify -# -# - python-linter -# - ubuntu-22.04 -# - test python linter -# - -name: ddsrouter-tests +# Tests to run with workflow-dispatch, pull-request and push events +name: test on: - workflow_dispatch: inputs: + custom_version_build: + description: > + Use the custom version build from eProsima-CI. + If set to false, the workflow will run the tests for Fast DDS v2 and v3. + required: true + type: choice + default: 'custom' + options: + - custom + - v2 + - v3 + dependencies_artifact_postfix: description: 'Postfix name to add to artifact name to download dependencies. This is use to download a specific artifact version from eProsima-CI.' required: true @@ -63,269 +26,13 @@ on: push: branches: - main - schedule: - - cron: '0 5 * * *' - -env: - code_packages_names: 'ddsrouter_core ddsrouter_yaml ddsrouter_tool' - docs_packages_names: 'ddsrouter_docs' - default_dependencies_artifact_postfix: '_nightly' jobs: - -##################################################################### -# TEST - - multiplatform-tests: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - cmake_build_type: - - Release - - Debug - os: - - ubuntu-20.04 - - ubuntu-22.04 - - windows-2019 - - windows-2022 - - steps: - - - name: Sync repository - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: ${{ github.workspace }}/src - - - name: Download dependencies and install requirements - uses: ./src/.github/actions/project_dependencies - with: - os: ${{ matrix.os }} - cmake_build_type: ${{ matrix.cmake_build_type }} - dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }} - secret_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Compile and run tests - id: compile_and_test - uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@main - with: - packages_names: ${{ env.code_packages_names }} - cmake_args: -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} - workspace_dependencies: ${{ github.workspace }}/install - ctest_args: --label-exclude "xfail" - colcon_meta_file: ${{ github.workspace }}/src/.github/workflows/configurations/${{ runner.os }}/colcon.meta - - - name: Test Report - uses: eProsima/eProsima-CI/external/test-reporter@main - if: success() || failure() - with: - name: "Report: ${{ matrix.os }} | ${{ matrix.cmake_build_type }} " - path: "${{ steps.compile_and_test.outputs.ctest_results_path }}*.xml" - working-directory: 'src' - path-replace-backslashes: 'true' - list-tests: 'failed' - -##################################################################### -# ASAN - - asan: - runs-on: ubuntu-22.04 - steps: - - - name: Sync repository - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: ${{ github.workspace }}/src - - - name: Download dependencies and install requirements - uses: ./src/.github/actions/project_dependencies - with: - os: ubuntu-22.04 - cmake_build_type: Release - dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }} - secret_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Compile and run tests - id: compile_and_test - uses: eProsima/eProsima-CI/multiplatform/asan_build_test@main - with: - packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install - - - name: Test Report - uses: eProsima/eProsima-CI/external/test-reporter@main - if: success() || failure() - with: - name: "Report: ASAN " - path: "${{ steps.compile_and_test.outputs.ctest_results_path }}*.xml" - working-directory: 'src' - list-tests: 'failed' - -##################################################################### -# TSAN - - tsan: - runs-on: ubuntu-22.04 - steps: - - - name: Sync repository - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: ${{ github.workspace }}/src - - - name: Download dependencies and install requirements - uses: ./src/.github/actions/project_dependencies - with: - os: ubuntu-22.04 - cmake_build_type: Release - dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }} - secret_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Compile and run tests - id: compile_and_test - uses: eProsima/eProsima-CI/multiplatform/tsan_build_test@main - with: - packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install - - - name: Test Report - uses: eProsima/eProsima-CI/external/test-reporter@main - if: success() || failure() - with: - name: "Report: TSAN " - path: "${{ steps.compile_and_test.outputs.ctest_results_path }}*.xml" - working-directory: 'src' - list-tests: 'failed' - -##################################################################### -# CLANG - - clang: - runs-on: ubuntu-22.04 - steps: - - - name: Sync repository - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: ${{ github.workspace }}/src - - - name: Download dependencies and install requirements - uses: ./src/.github/actions/project_dependencies - with: - os: ubuntu-22.04 - cmake_build_type: Release - dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }} - secret_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Compile and run tests - uses: eProsima/eProsima-CI/multiplatform/clang_build_test@v0 - with: - packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install - - -##################################################################### -# COVERAGE - - coverage: - runs-on: ubuntu-22.04 - environment: - name: codecov - steps: - - - name: Sync repository - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: ${{ github.workspace }}/src - - - name: Download dependencies and install requirements - uses: ./src/.github/actions/project_dependencies - with: - os: ubuntu-22.04 - cmake_build_type: Release - dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }} - secret_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Compile and run tests - uses: eProsima/eProsima-CI/ubuntu/coverage_build_test_upload@main - with: - packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install - codecov_token: ${{ secrets.CODECOV_TOKEN }} - codecov_fix_file_path: ${{ github.workspace }}/src/codecov.yml - - -##################################################################### -# FLAKY - - flaky: - runs-on: ubuntu-22.04 - steps: - - - name: Sync repository - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: ${{ github.workspace }}/src - - - name: Download dependencies and install requirements - uses: ./src/.github/actions/project_dependencies - with: - os: ubuntu-22.04 - cmake_build_type: Release - dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }} - secret_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Compile and run tests - id: compile_and_test - uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@main - with: - packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install - ctest_args: --label-regex "xfail" - - - name: Test Report - uses: eProsima/eProsima-CI/external/test-reporter@main - if: success() || failure() - with: - name: "Report: Flaky " - path: "${{ steps.compile_and_test.outputs.ctest_results_path }}*.xml" - working-directory: 'src' - fail-on-empty: 'false' - list-tests: 'failed' - -##################################################################### -# DOCUMENTATION TEST - - docs: - runs-on: ubuntu-22.04 - steps: - - name: Build and test documentation - uses: eProsima/eProsima-CI/ubuntu/sphinx_docs@main - with: - checkout_path: "${{ github.workspace }}/src/ddsrouter" - path_to_requirements: "${{ github.workspace }}/src/ddsrouter/docs/requirements.txt" - docs_subpackage_name: ${{ env.docs_packages_names }} - secret_token: ${{ secrets.GITHUB_TOKEN }} - - -##################################################################### -# UNCRUSTIFY - - uncrustify: - runs-on: ubuntu-22.04 - steps: - - - name: Uncrustify - uses: eProsima/eProsima-CI/ubuntu/uncrustify@v0 - - -##################################################################### -# PYTHON LINTER - - python-linter: - runs-on: ubuntu-22.04 - steps: - - - name: Python Linter - uses: eProsima/eProsima-CI/ubuntu/python_linter@v0 + reusable_tests: + name: reusable_tests + uses: ./.github/workflows/reusable-workflow.yml + with: + custom_version_build: ${{ inputs.custom_version_build || 'v2' }} + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix || '_nightly' }} + secrets: inherit