From c8fa5147d7a3da2e7752d068c24c45bc7fe3dfc4 Mon Sep 17 00:00:00 2001 From: Raul Sanchez-Mateos Lizano Date: Tue, 4 Jun 2024 09:05:02 +0200 Subject: [PATCH] Add mirror CI workflow (#118) * Bump CI to test with Fast DDS v3 Signed-off-by: Raul Sanchez-Mateos * Update artifact names Signed-off-by: Raul Sanchez-Mateos * Use gcc-12 in tsan job Signed-off-by: Raul Sanchez-Mateos --------- Signed-off-by: Raul Sanchez-Mateos --- .github/workflows/mirror.yml | 25 +++++++++ .github/workflows/nightly.yml | 6 +- .github/workflows/reusable-workflow.yml | 74 ++++++++++++++++++------- .github/workflows/test.yml | 5 +- 4 files changed, 86 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/mirror.yml diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml new file mode 100644 index 00000000..51a42040 --- /dev/null +++ b/.github/workflows/mirror.yml @@ -0,0 +1,25 @@ +name: mirror-branch + +on: + push: + branches: + - 'main' + +jobs: + mirror_job_main: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + name: Mirror main branch to API & ABI compatible minor version branches + strategy: + fail-fast: false + matrix: + dest_branch: + - '0.x' + steps: + - name: Mirror action step + id: mirror + uses: eProsima/eProsima-CI/external/mirror-branch-action@v0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + source: 'main' + dest: ${{ matrix.dest_branch }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 281e5fbb..aa7498a3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,5 +1,5 @@ # Nightly test workflow for DDS Pipe -name: nightly_test +name: nightly-ddspipe on: schedule: @@ -13,14 +13,14 @@ jobs: with: custom_version_build: 'v2' dependencies_artifact_postfix: '_nightly' + ref: '0.x' secrets: inherit - # Uncomment this block to run the tests for Fast DDS v3 when DDS Pipe 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' + # ref: 'main' # secrets: inherit diff --git a/.github/workflows/reusable-workflow.yml b/.github/workflows/reusable-workflow.yml index 7ebd9bcd..013aa7c7 100644 --- a/.github/workflows/reusable-workflow.yml +++ b/.github/workflows/reusable-workflow.yml @@ -64,6 +64,13 @@ on: default: '_nightly' type: string + ref: + description: > + The branch or tag name to checkout. + required: true + type: string + default: 'main' + env: code_packages_names: 'ddspipe_core ddspipe_yaml ddspipe_participants' @@ -84,14 +91,15 @@ jobs: - windows-2019 - windows-2022 env: - workspace_dependencies: '${{ github.workspace }}/install' + workspace_dependencies: 'install' steps: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src + ref: ${{ inputs.ref }} - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -106,7 +114,7 @@ jobs: - name: Compile with colcon uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 with: - colcon_meta_file: ${{ github.workspace }}/src/.github/workflows/configurations/${{ runner.os }}/colcon.meta + colcon_meta_file: src/.github/workflows/configurations/${{ runner.os }}/colcon.meta colcon_build_args: '--packages-up-to ${{ env.code_packages_names }}' cmake_args: ' -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}' workspace: '${{ github.workspace }}' @@ -154,7 +162,8 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src + ref: ${{ inputs.ref }} - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -170,9 +179,10 @@ 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 + test_report_artifact: test_report${{ inputs.dependencies_artifact_postfix }}_${{ inputs.custom_version_build }}_${{ matrix.os }}_${{ matrix.cmake_build_type }} ##################################################################### @@ -185,7 +195,8 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src + ref: ${{ inputs.ref }} - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -197,10 +208,14 @@ jobs: secret_token: ${{ secrets.GITHUB_TOKEN }} - name: Compile and run tests - uses: eProsima/eProsima-CI/multiplatform/asan_build_test@v0 + uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@v0 with: packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install + cmake_args: -DBUILD_TESTS=ON -DASAN_BUILD=ON + ctest_args: --label-exclude "xfail|xasan" + workspace_dependencies: install + cmake_build_type: Debug + test_report_artifact: test_report_asan${{ inputs.dependencies_artifact_postfix }}_${{ inputs.custom_version_build }} ##################################################################### @@ -213,7 +228,8 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src + ref: ${{ inputs.ref }} - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -225,10 +241,19 @@ jobs: secret_token: ${{ secrets.GITHUB_TOKEN }} - name: Compile and run tests - uses: eProsima/eProsima-CI/multiplatform/tsan_build_test@v0 + uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@v0 + env: + # GCC 11.3 (Ubuntu Jammy default) produces several false positives regarding timed synchronization protocols + # These issues were fixed in GCC 12 so we upgrade to that version. + CC: gcc-12 + CXX: g++-12 with: packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install + cmake_args: -DBUILD_TESTS=ON -DTSAN_BUILD=ON + ctest_args: --label-exclude "xfail|xtsan" + workspace_dependencies: install + cmake_build_type: Debug + test_report_artifact: test_report_tsan${{ inputs.dependencies_artifact_postfix }}_${{ inputs.custom_version_build }} ##################################################################### @@ -241,7 +266,8 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src + ref: ${{ inputs.ref }} - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -256,7 +282,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 ##################################################################### @@ -271,7 +297,8 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src + ref: ${{ inputs.ref }} - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -286,9 +313,10 @@ jobs: uses: eProsima/eProsima-CI/ubuntu/coverage_build_test_upload@v0 with: packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install + workspace_dependencies: install + test_report_artifact: test_report_coverage${{ inputs.dependencies_artifact_postfix }}_${{ inputs.custom_version_build }} codecov_token: ${{ secrets.CODECOV_TOKEN }} - codecov_fix_file_path: ${{ github.workspace }}/src/codecov.yml + codecov_fix_file_path: src/codecov.yml ##################################################################### @@ -301,7 +329,8 @@ jobs: - name: Sync repository uses: eProsima/eProsima-CI/external/checkout@v0 with: - path: ${{ github.workspace }}/src + path: src + ref: ${{ inputs.ref }} - name: Download dependencies and install requirements uses: ./src/.github/actions/project_dependencies @@ -313,10 +342,15 @@ jobs: secret_token: ${{ secrets.GITHUB_TOKEN }} - name: Compile and run tests - uses: eProsima/eProsima-CI/multiplatform/colcon_build_test_flaky@v0 + uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@v0 with: packages_names: ${{ env.code_packages_names }} - workspace_dependencies: ${{ github.workspace }}/install + cmake_args: -DBUILD_TESTS=ON + cmake_build_type: Release + workspace_dependencies: install + ctest_args: --label-regex "xfail" + colcon_meta_file: ./src/.github/workflows/configurations/${{ runner.os }}/colcon.meta + test_report_artifact: test_report_flaky${{ inputs.dependencies_artifact_postfix }}_${{ inputs.custom_version_build }} ##################################################################### diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03a9d250..4c7198f9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,9 @@ on: - 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.' + 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' @@ -35,4 +37,5 @@ jobs: with: custom_version_build: ${{ github.event.inputs.custom_version_build || 'v2' }} dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || '_nightly' }} + ref: ${{ github.ref }} secrets: inherit