From 6d899071bed1fa62d5379ad3f9dfcd9a8b623aea Mon Sep 17 00:00:00 2001 From: Raul Sanchez-Mateos Date: Mon, 13 May 2024 16:36:23 +0200 Subject: [PATCH 1/6] 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 | 347 ++--------------- 7 files changed, 472 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..2dfff34e8 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,25 @@ 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 + + reusable_docker_tests: + name: reusable_docker_tests + uses: ./.github/workflows/docker-reusable-workflow.yml + with: + fastcdr_branch: 'master' + fastdds_branch: '2.x' + ddspipe_branch: 'main' + ddsrouter_branch: ${{ inputs.ddsrouter_branch || github.head_ref }} + custom_version_build: ${{ inputs.custom_version_build || 'v2' }} + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix || '_nightly' }} + secrets: inherit From ae668947fdd8fd893209e8a254f017b7cc09076a Mon Sep 17 00:00:00 2001 From: Raul Sanchez-Mateos Date: Tue, 14 May 2024 07:50:30 +0200 Subject: [PATCH 2/6] Fix inputs in workflow dispatch Signed-off-by: Raul Sanchez-Mateos --- .github/workflows/nightly.yml | 2 +- .github/workflows/test.yml | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a1e3ed58d..86081dadc 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -29,7 +29,7 @@ jobs: name: reusable_docker_tests_v2 uses: ./.github/workflows/docker-reusable-workflow.yml with: - fastcdr_branch: 'master' + fastcdr_branch: '2.x' fastdds_branch: '2.x' ddspipe_branch: 'main' ddsrouter_branch: 'main' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2dfff34e8..9ff75dff2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,30 @@ on: workflow_dispatch: 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: > Use the custom version build from eProsima-CI. From 5c5f3c36ad7c87df5c022c57332be157545e79fc Mon Sep 17 00:00:00 2001 From: Raul Sanchez-Mateos Date: Tue, 14 May 2024 08:00:14 +0200 Subject: [PATCH 3/6] Add dev-utils branch Signed-off-by: Raul Sanchez-Mateos --- .../workflows/docker-reusable-workflow.yml | 7 ++++++ .github/workflows/nightly.yml | 2 +- .github/workflows/reusable-workflow.yml | 24 ------------------- .github/workflows/test.yml | 13 +++++++--- 4 files changed, 18 insertions(+), 28 deletions(-) diff --git a/.github/workflows/docker-reusable-workflow.yml b/.github/workflows/docker-reusable-workflow.yml index 6419e1e20..0bb5f0332 100644 --- a/.github/workflows/docker-reusable-workflow.yml +++ b/.github/workflows/docker-reusable-workflow.yml @@ -16,6 +16,12 @@ on: default: 'master' type: string + dev_utils_branch: + description: 'Branch or tag of eProsima/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 @@ -78,6 +84,7 @@ jobs: --no-cache \ --build-arg fastcdr_branch=${{ inputs.fastcdr_branch }} \ --build-arg fastdds_branch=${{ inputs.fastdds_branch }} \ + --build-arg dev_utils_branch=${{ inputs.dev_utils_branch }} \ --build-arg ddspipe_branch=${{ inputs.ddspipe_branch }} \ --build-arg ddsrouter_branch=${{ inputs.ddsrouter_branch }} \ -t ${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }} \ diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 86081dadc..f488575f0 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -43,7 +43,7 @@ jobs: # name: reusable_docker_tests_v3 # uses: ./.github/workflows/docker-reusable-workflow.yml # with: - # fastcdr_branch: 'master' + # fastcdr_branch: '2.x' # fastdds_branch: '3.x' # ddspipe_branch: 'main' # ddsrouter_branch: 'main' diff --git a/.github/workflows/reusable-workflow.yml b/.github/workflows/reusable-workflow.yml index d61d5ad74..408c62184 100644 --- a/.github/workflows/reusable-workflow.yml +++ b/.github/workflows/reusable-workflow.yml @@ -45,30 +45,6 @@ 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. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ff75dff2..3e95a3d30 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,6 +17,12 @@ on: default: 'master' type: string + dev_utils_branch: + description: 'Branch or tag of eProsima/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 @@ -65,9 +71,10 @@ jobs: name: reusable_docker_tests uses: ./.github/workflows/docker-reusable-workflow.yml with: - fastcdr_branch: 'master' - fastdds_branch: '2.x' - ddspipe_branch: 'main' + fastcdr_branch: ${{ inputs.fastcdr_branch || '2.x' }} + fastdds_branch: ${{ inputs.fastdds_branch || '2.x' }} + dev_utils_branch: ${{ inputs.dev_utils_branch || 'main' }} + ddspipe_branch: ${{ inputs.ddspipe_branch || 'main' }} ddsrouter_branch: ${{ inputs.ddsrouter_branch || github.head_ref }} custom_version_build: ${{ inputs.custom_version_build || 'v2' }} dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix || '_nightly' }} From 77615afc19f9fdbea6cefe11b267783b95a46724 Mon Sep 17 00:00:00 2001 From: Raul Sanchez-Mateos Date: Tue, 14 May 2024 09:10:10 +0200 Subject: [PATCH 4/6] Update fastcdr default version Signed-off-by: Raul Sanchez-Mateos --- .github/docker/ddsrouter/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/docker/ddsrouter/Dockerfile b/.github/docker/ddsrouter/Dockerfile index 1aa35a16a..f63b02105 100644 --- a/.github/docker/ddsrouter/Dockerfile +++ b/.github/docker/ddsrouter/Dockerfile @@ -42,7 +42,7 @@ RUN pip3 install \ WORKDIR /ddsrouter -ARG fastcdr_branch=master +ARG fastcdr_branch=2.x ARG fastdds_branch=2.x ARG devutils_branch=main ARG ddspipe_branch=main From a074d49a94de147c356794ea4e73145ef3480092 Mon Sep 17 00:00:00 2001 From: Raul Sanchez-Mateos Date: Tue, 14 May 2024 09:36:28 +0200 Subject: [PATCH 5/6] Remove redundant github workspace in paths Signed-off-by: Raul Sanchez-Mateos --- .github/workflows/reusable-workflow.yml | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/reusable-workflow.yml b/.github/workflows/reusable-workflow.yml index 408c62184..55bcaa314 100644 --- a/.github/workflows/reusable-workflow.yml +++ b/.github/workflows/reusable-workflow.yml @@ -87,7 +87,7 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -104,9 +104,9 @@ jobs: with: packages_names: ${{ env.code_packages_names }} cmake_args: -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} - workspace_dependencies: ${{ github.workspace }}/install + workspace_dependencies: install ctest_args: --label-exclude "xfail" - colcon_meta_file: ${{ github.workspace }}/src/.github/workflows/configurations/${{ runner.os }}/colcon.meta + colcon_meta_file: src/.github/workflows/configurations/${{ runner.os }}/colcon.meta - name: Test Report uses: eProsima/eProsima-CI/external/test-reporter@main @@ -128,7 +128,7 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -144,7 +144,7 @@ jobs: uses: eProsima/eProsima-CI/multiplatform/asan_build_test@main with: packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install + workspace_dependencies: install - name: Test Report uses: eProsima/eProsima-CI/external/test-reporter@main @@ -165,7 +165,7 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -181,7 +181,7 @@ jobs: uses: eProsima/eProsima-CI/multiplatform/tsan_build_test@main with: packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install + workspace_dependencies: install - name: Test Report uses: eProsima/eProsima-CI/external/test-reporter@main @@ -202,7 +202,7 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -217,7 +217,7 @@ jobs: uses: eProsima/eProsima-CI/multiplatform/clang_build_test@v0 with: packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install + workspace_dependencies: install ##################################################################### @@ -232,7 +232,7 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -247,9 +247,9 @@ jobs: uses: eProsima/eProsima-CI/ubuntu/coverage_build_test_upload@main with: packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install + workspace_dependencies: install codecov_token: ${{ secrets.CODECOV_TOKEN }} - codecov_fix_file_path: ${{ github.workspace }}/src/codecov.yml + codecov_fix_file_path: src/codecov.yml ##################################################################### @@ -262,7 +262,7 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -278,7 +278,7 @@ jobs: uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@main with: packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install + workspace_dependencies: install ctest_args: --label-regex "xfail" - name: Test Report @@ -300,8 +300,8 @@ jobs: - 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" + checkout_path: "src/ddsrouter" + path_to_requirements: "src/ddsrouter/docs/requirements.txt" docs_subpackage_name: ${{ env.docs_packages_names }} secret_token: ${{ secrets.GITHUB_TOKEN }} From c04591d6a20cb6a9ade3f486d4154ca0ba88b5f0 Mon Sep 17 00:00:00 2001 From: Raul Sanchez-Mateos Date: Tue, 14 May 2024 09:44:57 +0200 Subject: [PATCH 6/6] Remove redundant github workspace in paths in docker workflow Signed-off-by: Raul Sanchez-Mateos --- .github/workflows/docker-reusable-workflow.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-reusable-workflow.yml b/.github/workflows/docker-reusable-workflow.yml index 0bb5f0332..e9b201ff7 100644 --- a/.github/workflows/docker-reusable-workflow.yml +++ b/.github/workflows/docker-reusable-workflow.yml @@ -64,7 +64,7 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src # Build Vulcanexus Docker image - name: Build custom Vulcanexus Docker image @@ -111,8 +111,8 @@ jobs: workspace: ${{ github.workspace }} colcon_build_args: --packages-up-to ddsrouter_test cmake_args: -DBUILD_COMPOSE_TESTS=ON -DCMAKE_BUILD_TYPE=Release - workspace_dependencies: ${{ github.workspace }}/install - colcon_meta_file: ${{ github.workspace }}/src/.github/workflows/configurations/${{ runner.os }}/colcon.meta + workspace_dependencies: install + colcon_meta_file: src/.github/workflows/configurations/${{ runner.os }}/colcon.meta # Run ddsrouter_test compose tests - name: Run flaky tests @@ -120,7 +120,7 @@ jobs: run: | export DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE=${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }} export DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE=${{ env.DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE }} - source ${{ github.workspace }}/install/setup.bash + source install/setup.bash colcon test \ --packages-select ddsrouter_test \ --event-handlers console_direct+ \ @@ -133,7 +133,7 @@ jobs: run: | export DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE=${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }} export DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE=${{ env.DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE }} - source ${{ github.workspace }}/install/setup.bash + source install/setup.bash colcon test \ --packages-select ddsrouter_test \ --event-handlers console_direct+ \