diff --git a/.github/actions/install-python-packages/action.yml b/.github/actions/install-python-packages/action.yml deleted file mode 100644 index 837107a8f6..0000000000 --- a/.github/actions/install-python-packages/action.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: 'install-python-packages' -description: 'Install necessary python packages' -runs: - using: "composite" - steps: - - id: install-python-packages - run: | - sudo pip3 install -U \ - colcon-common-extensions \ - colcon-mixin \ - vcstool \ - setuptools \ - gcovr \ - tomark \ - xmltodict \ - jsondiff \ - pandas - shell: bash diff --git a/.github/workflows/asan/asan_colcon.meta b/.github/workflows/config/asan_colcon.meta similarity index 100% rename from .github/workflows/asan/asan_colcon.meta rename to .github/workflows/config/asan_colcon.meta diff --git a/.github/workflows/config/coverage.meta b/.github/workflows/config/coverage.meta deleted file mode 100644 index 747b8b9fe9..0000000000 --- a/.github/workflows/config/coverage.meta +++ /dev/null @@ -1,25 +0,0 @@ - -{ - "names": - { - "fastrtps" : - { - "cmake-args": [ - "-DEPROSIMA_BUILD=ON", - "-DINTERNAL_DEBUG=ON", - "-DGTEST_INDIVIDUAL=ON", - "-DFASTRTPS_API_TESTS=ON", - "-DFASTDDS_PIM_API_TESTS=ON", - "-DPERFORMANCE_TESTS=ON", - "-DSECURITY=OFF", - "-DCMAKE_BUILD_TYPE=Debug", - "-DPROFILING_TESTS=ON", - "-DVIDEO_TESTS=ON" - ] - }, - "googletest-distribution" : - { - "cmake-args" : ["-Dgtest_force_shared_crt=ON"] - } - } -} diff --git a/.github/workflows/config/coverage.repos b/.github/workflows/config/coverage.repos index 9045a0989f..f6580b0e8f 100644 --- a/.github/workflows/config/coverage.repos +++ b/.github/workflows/config/coverage.repos @@ -2,7 +2,7 @@ repositories: fastcdr: type: git url: https://github.com/eProsima/Fast-CDR.git - version: master + version: 1.1.x foonathan_memory_vendor: type: git url: https://github.com/eProsima/foonathan_memory_vendor.git diff --git a/.github/workflows/config/default_ci.repos b/.github/workflows/config/default_ci_2.10.x.repos similarity index 87% rename from .github/workflows/config/default_ci.repos rename to .github/workflows/config/default_ci_2.10.x.repos index 5d3651ca82..e5a8ab31ec 100644 --- a/.github/workflows/config/default_ci.repos +++ b/.github/workflows/config/default_ci_2.10.x.repos @@ -2,11 +2,11 @@ repositories: fastcdr: type: git url: https://github.com/eProsima/Fast-CDR.git - version: master + version: 1.0.x foonathan_memory_vendor: type: git url: https://github.com/eProsima/foonathan_memory_vendor.git - version: master + version: v1.3.0 googletest-distribution: type: git url: https://github.com/google/googletest.git diff --git a/.github/workflows/config/nightly.repos b/.github/workflows/config/default_ci_2.11.x.repos similarity index 87% rename from .github/workflows/config/nightly.repos rename to .github/workflows/config/default_ci_2.11.x.repos index 5d3651ca82..abef4e4e7b 100644 --- a/.github/workflows/config/nightly.repos +++ b/.github/workflows/config/default_ci_2.11.x.repos @@ -2,11 +2,11 @@ repositories: fastcdr: type: git url: https://github.com/eProsima/Fast-CDR.git - version: master + version: 1.1.x foonathan_memory_vendor: type: git url: https://github.com/eProsima/foonathan_memory_vendor.git - version: master + version: v1.3.1 googletest-distribution: type: git url: https://github.com/google/googletest.git diff --git a/.github/workflows/config/default_ci_2.6.x.repos b/.github/workflows/config/default_ci_2.6.x.repos new file mode 100644 index 0000000000..dafcf2fd3f --- /dev/null +++ b/.github/workflows/config/default_ci_2.6.x.repos @@ -0,0 +1,13 @@ +repositories: + fastcdr: + type: git + url: https://github.com/eProsima/Fast-CDR.git + version: 1.0.x + foonathan_memory_vendor: + type: git + url: https://github.com/eProsima/foonathan_memory_vendor.git + version: v1.2.1 + googletest-distribution: + type: git + url: https://github.com/google/googletest.git + version: release-1.11.0 diff --git a/.github/workflows/config/nightly_2.10.x.repos b/.github/workflows/config/nightly_2.10.x.repos new file mode 100644 index 0000000000..e5a8ab31ec --- /dev/null +++ b/.github/workflows/config/nightly_2.10.x.repos @@ -0,0 +1,13 @@ +repositories: + fastcdr: + type: git + url: https://github.com/eProsima/Fast-CDR.git + version: 1.0.x + foonathan_memory_vendor: + type: git + url: https://github.com/eProsima/foonathan_memory_vendor.git + version: v1.3.0 + googletest-distribution: + type: git + url: https://github.com/google/googletest.git + version: release-1.11.0 diff --git a/.github/workflows/config/nightly_2.11.x.repos b/.github/workflows/config/nightly_2.11.x.repos new file mode 100644 index 0000000000..abef4e4e7b --- /dev/null +++ b/.github/workflows/config/nightly_2.11.x.repos @@ -0,0 +1,13 @@ +repositories: + fastcdr: + type: git + url: https://github.com/eProsima/Fast-CDR.git + version: 1.1.x + foonathan_memory_vendor: + type: git + url: https://github.com/eProsima/foonathan_memory_vendor.git + version: v1.3.1 + googletest-distribution: + type: git + url: https://github.com/google/googletest.git + version: release-1.11.0 diff --git a/.github/workflows/config/nightly_2.6.x.repos b/.github/workflows/config/nightly_2.6.x.repos new file mode 100644 index 0000000000..dafcf2fd3f --- /dev/null +++ b/.github/workflows/config/nightly_2.6.x.repos @@ -0,0 +1,13 @@ +repositories: + fastcdr: + type: git + url: https://github.com/eProsima/Fast-CDR.git + version: 1.0.x + foonathan_memory_vendor: + type: git + url: https://github.com/eProsima/foonathan_memory_vendor.git + version: v1.2.1 + googletest-distribution: + type: git + url: https://github.com/google/googletest.git + version: release-1.11.0 diff --git a/.github/workflows/config/tsan_colcon.meta b/.github/workflows/config/tsan_colcon.meta new file mode 100644 index 0000000000..3b45525dec --- /dev/null +++ b/.github/workflows/config/tsan_colcon.meta @@ -0,0 +1,31 @@ +{ + "names": + { + "fastcdr": + { + "cmake-args": + [ + "-DCMAKE_C_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'", + "-DCMAKE_CXX_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'" + ] + }, + "fastrtps": + { + "cmake-args": + [ + "-DCOMPILE_EXAMPLES=OFF", + "-DEPROSIMA_BUILD_TESTS=ON", + "-DGTEST_INDIVIDUAL=ON", + "-DRTPS_API_TESTS=ON", + "-DFASTRTPS_API_TESTS=OFF", + "-DFASTDDS_PIM_API_TESTS=ON", + "-DPERFORMANCE_TESTS=ON", + "-DSECURITY=ON", + "-DFASTDDS_STATISTICS=ON", + "-DCMAKE_C_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'", + "-DCMAKE_CXX_FLAGS='-fsanitize=thread -O2 -g -fno-omit-frame-pointer'" + ] + } + + } +} diff --git a/.github/workflows/documentation-tests.yaml b/.github/workflows/documentation-tests.yaml index 18a48cd3e6..da179df413 100644 --- a/.github/workflows/documentation-tests.yaml +++ b/.github/workflows/documentation-tests.yaml @@ -9,7 +9,7 @@ on: push: branches: - - 'master' + - '2.11.x' paths-ignore: - '**.md' - '**.txt' @@ -17,7 +17,7 @@ on: pull_request: branches: - - 'master' + - '2.11.x' paths-ignore: - '**.md' - '**.txt' @@ -93,9 +93,14 @@ jobs: path: src/fastdds-docs ref: ${{ env.ACTION_BRANCH_NAME }} + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 + - name: Install required python packages - run: | - pip3 install -r src/fastdds-docs/docs/requirements.txt + uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 + with: + upgrade: false + requirements_file_name: src/fastdds-docs/docs/requirements.txt - name: Build documentation run: | diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 1f87e00bd9..091bf3f1e6 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -11,11 +11,11 @@ jobs: fail-fast: false matrix: dest_branch: - - '2.11.x' + - '2.12.x' steps: - name: Mirror action step id: mirror - uses: google/mirror-branch-action@v1.0 + uses: eProsima/eProsima-CI/external/mirror-branch-action@v0 with: github-token: ${{ secrets.GITHUB_TOKEN }} source: 'master' diff --git a/.github/workflows/nightly-windows-ci.yml b/.github/workflows/nightly-windows-ci.yml index 3d1555cc81..c5390e7e94 100644 --- a/.github/workflows/nightly-windows-ci.yml +++ b/.github/workflows/nightly-windows-ci.yml @@ -12,6 +12,7 @@ jobs: label: 'nightly-sec-windows-ci' cmake-args: "-DSECURITY=ON" ctest-args: "-LE xfail" + fastdds_branch: '2.11.x' nightly-nosec-windows-ci: uses: ./.github/workflows/reusable-windows-ci.yml @@ -19,3 +20,4 @@ jobs: label: 'nightly-nosec-windows-ci' cmake-args: "-DSECURITY=OFF" ctest-args: "-LE xfail" + fastdds_branch: '2.11.x' diff --git a/.github/workflows/reusable-windows-ci.yml b/.github/workflows/reusable-windows-ci.yml index f063e9dd60..2e21df329e 100644 --- a/.github/workflows/reusable-windows-ci.yml +++ b/.github/workflows/reusable-windows-ci.yml @@ -19,6 +19,10 @@ on: description: 'Extra arguments for ctest cli' required: false type: string + fastdds_branch: + description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)' + required: true + type: string defaults: run: @@ -135,10 +139,40 @@ jobs: # WER service is manual by default Start-Service WerSvc - - name: Install colcon and other python packages + - name: Install OpenSSL + uses: eProsima/eprosima-CI/windows/install_openssl@v0 + + - name: Update OpenSSL environment variables run: | - pip3 install -U colcon-common-extensions vcstool colcon-mixin xmlschema + # Update the environment + if (Test-Path -Path $Env:ProgramW6432\OpenSSL) + { + "OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM + } + elseif (Test-Path -Path $Env:ProgramW6432\OpenSSL-Win) + { + "OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL-Win" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM + } + elseif (Test-Path -Path $Env:ProgramW6432\OpenSSL-Win64) + { + "OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL-Win64" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM + } + else + { + Write-Error -Message "Cannot find OpenSSL installation." + exit 1 + } + - name: Install colcon + uses: eProsima/eProsima-CI/windows/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/windows/install_python_packages@v0 + with: + packages: vcstool xmlschema + + - name: Patch colcon for issue with VS2022 + run: | # patch colcon issue with visual studio 2022 $patch = gci -Include build.py -Recurse ` -Path ((gcm colcon).source | Split-Path | Join-Path -ChildPath "..\Lib\site-packages\colcon_cmake\*") @@ -200,14 +234,6 @@ jobs: # clean up 'build', 'googletest', 'gtest.log' | del -Recurse -Force - - name: Install OpenSSL - uses: eProsima/eprosima-CI/windows/install_openssl@v0 - - - name: Update OpenSSL environment variables - run: | - # Update the environment - "OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM - - name: Update known hosts file for DNS resolver testing if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') }} run: | @@ -348,13 +374,21 @@ jobs: # Nightly job if ("${{ inputs.label }}".Contains("nightly")) { - $depends_repos_path = ".\src\fastrtps\.github\workflows\config\nightly.repos" + $depends_repos_path = ".\src\fastrtps\.github\workflows\config\nightly_${{ inputs.fastdds_branch }}.repos" + if (!(Test-Path -Path $depends_repos_path)) + { + $depends_repos_path = ".\src\fastrtps\.github\workflows\config\nightly_master.repos" + } $meta_path = ".\src\fastrtps\.github\workflows\config\nightly.meta" } # Either PR or manual else { - $depends_repos_path = ".\src\fastrtps\.github\workflows\config\default_ci.repos" + $depends_repos_path = ".\src\fastrtps\.github\workflows\config\default_ci_${{ inputs.fastdds_branch }}.repos" + if (!(Test-Path -Path $depends_repos_path)) + { + $depends_repos_path = ".\src\fastrtps\.github\workflows\config\default_ci_master.repos" + } $meta_path = ".\src\fastrtps\.github\workflows\config\default_ci.meta" } Write-Output "Selected repos files: $depends_repos_path" diff --git a/.github/workflows/sanitizer-tests.yaml b/.github/workflows/sanitizer-tests.yaml index c8694cc511..201f63c4ac 100644 --- a/.github/workflows/sanitizer-tests.yaml +++ b/.github/workflows/sanitizer-tests.yaml @@ -6,6 +6,10 @@ on: discovery_server_branch: description: 'Branch or tag of Discovery Server repository (https://github.com/eProsima/Discovery-Server)' required: true + default: 'v1.2.1' + fastdds_branch: + description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)' + required: true default: 'master' pull_request: push: @@ -23,30 +27,56 @@ jobs: runs-on: ubuntu-22.04 + env: + FASTDDS_BRANCH: ${{ github.head_ref || github.event.inputs.fastdds_branch || 'master' }} + steps: - - name: Sync eProsima/Fast-DDS repository - uses: actions/checkout@v3 + - name: Install wget + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 with: - path: src/Fast-DDS + packages: wget - - name: Install apt packages - uses: ./src/Fast-DDS/.github/actions/install-apt-packages + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 - - name: Install Python packages - uses: ./src/Fast-DDS/.github/actions/install-python-packages + - name: Install Python dependencies + uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 + with: + packages: vcstool setuptools gcovr tomark xmltodict jsondiff pandas - - name: Fetch Fast DDS dependencies - uses: ./src/Fast-DDS/.github/actions/fetch-fastdds-repos + - name: Get fastrtps.repos file + uses: eProsima/eProsima-CI/ubuntu/get_file_from_repo@v0 with: - target_directory: src - googletest: true + source_repository: eProsima/Fast-DDS + source_repository_branch: ${{ env.FASTDDS_BRANCH }} + file_name: fastrtps.repos + file_result: fastrtps.repos + + - name: Fetch Fast DDS & dependencies + uses: eProsima/eProsima-CI/ubuntu/vcs_import@v0 + with: + vcs_repos_file: fastrtps.repos + destination_workspace: src + + - name: Checkout Fast DDS branch + run: | + cd ./src/fastrtps + git checkout ${{ env.FASTDDS_BRANCH }} + + - name: Install apt packages + uses: ./src/fastrtps/.github/actions/install-apt-packages + + - name: Install GTest + uses: eProsima/eProsima-CI/ubuntu/install_gtest@v0 + with: + version: v1.12.1 - name: Build workspace run: | - cat src/Fast-DDS/.github/workflows/asan/asan_colcon.meta + cat src/fastrtps/.github/workflows/config/asan_colcon.meta colcon build \ --event-handlers=console_direct+ \ - --metas src/Fast-DDS/.github/workflows/asan/asan_colcon.meta + --metas src/fastrtps/.github/workflows/config/asan_colcon.meta - name: Run tests Fast DDS run: | @@ -70,8 +100,8 @@ jobs: - name: Report ASAN errors if: always() run: | - bash src/Fast-DDS/.github/workflows/utils/specific_errors_filter.sh "==ERROR:" log/latest_test/fastrtps/stdout_stderr.log _tmp_specific_error_file.log - python3 src/Fast-DDS/.github/workflows/utils/log_parser.py --log-file log/latest_test/fastrtps/stdout_stderr.log --specific-error-file _tmp_specific_error_file.log --output-file $GITHUB_STEP_SUMMARY --sanitizer asan + bash src/fastrtps/.github/workflows/utils/specific_errors_filter.sh "==ERROR:" log/latest_test/fastrtps/stdout_stderr.log _tmp_specific_error_file.log + python3 src/fastrtps/.github/workflows/utils/log_parser.py --log-file log/latest_test/fastrtps/stdout_stderr.log --specific-error-file _tmp_specific_error_file.log --output-file $GITHUB_STEP_SUMMARY --sanitizer asan asan-discovery-server-test: @@ -81,34 +111,64 @@ jobs: runs-on: ubuntu-22.04 + env: + FASTDDS_BRANCH: ${{ github.head_ref || github.event.inputs.fastdds_branch || 'master' }} + DEFAULT_DISCOVERY_SERVER_BRANCH: ${{ github.event.inputs.discovery_server_branch || 'v1.2.1' }} + steps: - - name: Sync eProsima/Fast-DDS repository - uses: actions/checkout@v3 + - name: Install wget + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 with: - path: src/Fast-DDS + packages: wget - - name: Install apt packages - uses: ./src/Fast-DDS/.github/actions/install-apt-packages + - 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 setuptools gcovr tomark xmltodict jsondiff pandas + + - name: Get fastrtps.repos file + uses: eProsima/eProsima-CI/ubuntu/get_file_from_repo@v0 + with: + source_repository: eProsima/Fast-DDS + source_repository_branch: ${{ env.FASTDDS_BRANCH }} + file_name: fastrtps.repos + file_result: fastrtps.repos + + - name: Fetch Fast DDS & dependencies + uses: eProsima/eProsima-CI/ubuntu/vcs_import@v0 + with: + vcs_repos_file: fastrtps.repos + destination_workspace: src + + - name: Checkout Fast DDS branch + run: | + cd ./src/fastrtps + git checkout ${{ env.FASTDDS_BRANCH }} - - name: Install Python packages - uses: ./src/Fast-DDS/.github/actions/install-python-packages + - name: Sync eProsima/Discovery-Server repository + uses: actions/checkout@v4 + with: + path: src/discovery_server + repository: eProsima/Discovery-Server + ref: ${{ env.DEFAULT_DISCOVERY_SERVER_BRANCH }} + + - name: Install apt packages + uses: ./src/fastrtps/.github/actions/install-apt-packages - - name: Fetch Fast DDS dependencies - uses: ./src/Fast-DDS/.github/actions/fetch-fastdds-repos - env: - DEFAULT_DISCOVERY_SERVER_BRANCH: 'master' + - name: Install GTest + uses: eProsima/eProsima-CI/ubuntu/install_gtest@v0 with: - target_directory: src - googletest: true - discovery_server: true - discovery_server_branch: ${{ github.event.inputs.discovery_server_branch || env.DEFAULT_DISCOVERY_SERVER_BRANCH }} + version: v1.12.1 - name: Build workspace run: | - cat src/Fast-DDS/.github/workflows/asan/asan_colcon.meta + cat src/fastrtps/.github/workflows/config/asan_colcon.meta colcon build \ --event-handlers=console_direct+ \ - --metas src/Fast-DDS/.github/workflows/asan/asan_colcon.meta + --metas src/fastrtps/.github/workflows/config/asan_colcon.meta - name: Run tests Fast DDS run: | @@ -132,5 +192,5 @@ jobs: - name: Report ASAN errors if: always() run: | - bash src/Fast-DDS/.github/workflows/utils/specific_errors_filter.sh "==ERROR:" log/latest_test/discovery-server/stdout_stderr.log _tmp_specific_error_file.log - python3 src/Fast-DDS/.github/workflows/utils/log_parser.py --log-file log/latest_test/discovery-server/stdout_stderr.log --specific-error-file _tmp_specific_error_file.log --output-file $GITHUB_STEP_SUMMARY --sanitizer=asan + bash src/fastrtps/.github/workflows/utils/specific_errors_filter.sh "==ERROR:" log/latest_test/discovery-server/stdout_stderr.log _tmp_specific_error_file.log + python3 src/fastrtps/.github/workflows/utils/log_parser.py --log-file log/latest_test/discovery-server/stdout_stderr.log --specific-error-file _tmp_specific_error_file.log --output-file $GITHUB_STEP_SUMMARY --sanitizer=asan diff --git a/.github/workflows/statistics_coverage.yml b/.github/workflows/statistics_coverage.yml deleted file mode 100644 index a63802f228..0000000000 --- a/.github/workflows/statistics_coverage.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: statistics_coverage - -on: - workflow_dispatch: - -jobs: - ubuntu-build-test: - runs-on: ubuntu-latest - environment: - name: codecov - - steps: - - uses: actions/checkout@v2 - with: - path: src/Fast-DDS - - - uses: ./src/Fast-DDS/.github/actions/install-apt-packages - - uses: ./src/Fast-DDS/.github/actions/install-python-packages - - uses: ./src/Fast-DDS/.github/actions/fetch-fastdds-repos - - - name: Update colcon mixin - run: | - colcon mixin add default \ - https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml - colcon mixin update default - continue-on-error: true - - - name: Build workspace - run: | - cat src/Fast-DDS/.github/workflows/statistics_module.meta - colcon build \ - --packages-up-to fastrtps --packages-skip fastrtps \ - --event-handlers=console_direct+ \ - --metas src/Fast-DDS/.github/workflows/statistics_module.meta \ - --mixin coverage-gcc - for target in RTPSStatisticsTests StatisticsDomainParticipantTests StatisticsQosTests DomainParticipantStatisticsListenerTests StatisticsDomainParticipantMockTests BlackboxTests_DDS_PIM - do - colcon build \ - --packages-select fastrtps \ - --cmake-target $target \ - --cmake-target-skip-unavailable \ - --event-handlers=console_direct+ \ - --metas src/Fast-DDS/.github/workflows/statistics_module.meta \ - --mixin coverage-gcc - done - - - name: Run tests - run: | - colcon test \ - --packages-select fastrtps \ - --event-handlers=console_direct+ \ - --ctest-args -R RTPSStatisticsTests -R Statistics - - - name: Generate coverage report - run: | - cp src/Fast-DDS/codecov.yml . - mkdir coverage-report - gcovr \ - --root src/Fast-DDS/ \ - --object-directory build/fastrtps \ - --output coverage-report/coverage.xml \ - --xml-pretty \ - --exclude='.*examples/.*' \ - --exclude='.*thirdparty/.*' \ - --exclude='.*test/.*' \ - --exclude='.*/sqlite3.c' \ - --exclude='.*/optionparser.h' \ - --exclude='.*/optionparser.hpp' \ - --exclude-unreachable-branches - - - name: Upload coverage - uses: actions/upload-artifact@v1 - with: - name: coverage-report - path: coverage-report/ - if: always() - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: coverage-report/coverage.xml - root_dir: src/Fast-DDS - fail_ci_if_error: true diff --git a/.github/workflows/statistics_module.meta b/.github/workflows/statistics_module.meta deleted file mode 100644 index b4b44d9ffa..0000000000 --- a/.github/workflows/statistics_module.meta +++ /dev/null @@ -1,19 +0,0 @@ -{ - "names": - { - "fastrtps" : - { - "cmake-args": [ - "-DCMAKE_BUILD_TYPE=Debug", - "-DINTERNAL_DEBUG=ON", - "-DEPROSIMA_BUILD=ON", - "-DLOG_NO_INFO=ON", - "-DSECURITY=ON", - "-DTHIRDPARTY=ON", - "-DGTEST_INDIVIDUAL=ON", - "-DFASTDDS_PIM_API_TESTS=ON", - "-DFASTDDS_STATISTICS=ON", - ] - } - } -} diff --git a/.github/workflows/thread-sanitizer.yaml b/.github/workflows/thread-sanitizer.yaml index c74c5e193d..10db4044a5 100644 --- a/.github/workflows/thread-sanitizer.yaml +++ b/.github/workflows/thread-sanitizer.yaml @@ -2,6 +2,10 @@ name: Thread Sanitizer analysis on: workflow_dispatch: inputs: + fastdds_branch: + description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)' + required: true + default: 'master' optional_cmake_args: description: 'Optional CMake Compilation Flags' required: false @@ -27,139 +31,109 @@ on: - '**.txt' - '!**/CMakeLists.txt' -env: - TSAN_OPTIONS: second_deadlock_stack=1 history_size=7 memory_limit_mb=5000 - # ubuntu host doesn't have an environment SHELL value (docker and vm images does)??? - SHELL: /bin/bash - # 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 - -defaults: - run: - shell: pwsh - working-directory: /home/runner/work +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: + ubuntu-sanitizer-run: name: Sanitizer Evaluation + if: ${{ !(contains(github.event.pull_request.labels.*.name, 'no-test') || contains(github.event.pull_request.labels.*.name, 'skip-ci')) }} + runs-on: ubuntu-22.04 + + env: + FASTDDS_BRANCH: ${{ github.head_ref || github.event.inputs.fastdds_branch || 'master' }} + TSAN_OPTIONS: second_deadlock_stack=1 history_size=7 memory_limit_mb=5000 + # 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 + steps: - - name: Download the sanitizers cmake module and apply some fixes - run: | - git config --global user.email "dummy@mail.com" - git config --global user.name "dummy" - cd (New-Item -ItemType Directory -Path ./ws) - git clone https://github.com/arsenm/sanitizers-cmake - cd sanitizers-cmake - git remote add efork https://github.com/MiguelBarro/sanitizers-cmake.git - git fetch efork - git merge --no-edit efork/bugfix/cmake_updates - - - name: Download googletest and make it sanitizer aware - run: | - cd ws - git clone --branch release-1.11.0 https://github.com/google/googletest.git - cd googletest - git remote add efork https://github.com/MiguelBarro/googletest.git - git fetch efork - git merge --no-edit efork/bugfix/add_sanitizer_support - - - name: Build & install googletest - run: | - cd ws - cmake -DCMAKE_MODULE_PATH="$(pwd)/sanitizers-cmake/cmake" -DCMAKE_INSTALL_PREFIX="./install" ` - -DBUILD_GMOCK=ON -DSANITIZE_THREAD=ON -DCMAKE_BUILD_TYPE=Debug ` - -DCMAKE_VERBOSE_MAKEFILE=ON -B ./build/googletest ./googletest - cmake --build ./build/googletest --target install --verbose + - name: Install wget + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: wget - - name: Download Fast-CDR and make it sanitizer aware - run: | - cd ws - git clone https://github.com/eProsima/Fast-CDR.git - cd Fast-CDR - git remote add efork https://github.com/MiguelBarro/Fast-CDR.git - git fetch efork - git merge --no-edit efork/bugfix/add_sanitizer_support - - - name: Build & install Fast-CDR - run: | - cd ws - cmake -DCMAKE_INSTALL_PREFIX="./install" -DCMAKE_PREFIX_PATH="./install" ` - -DCMAKE_MODULE_PATH="$(pwd)/sanitizers-cmake/cmake" -DCMAKE_VERBOSE_MAKEFILE=ON ` - -DSANITIZE_THREAD=ON -DCMAKE_BUILD_TYPE=Debug -B ./build/fastcdr ./Fast-CDR - cmake --build ./build/fastcdr --target install --verbose + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 - - name: Download foonathan/memory and make it sanitizer aware - run: | - cd ws - git clone https://github.com/foonathan/memory.git - cd memory - git remote add efork https://github.com/MiguelBarro/memory.git - git fetch efork - git merge --no-edit efork/bugfix/add_sanitizer_support - - - name: Build & install foonathan/memory - run: | - cd ws - cmake -DCMAKE_MODULE_PATH="$(pwd)/sanitizers-cmake/cmake" -DCMAKE_VERBOSE_MAKEFILE=ON -DSANITIZE_THREAD=ON ` - -DCMAKE_INSTALL_PREFIX="./install" -DFOONATHAN_MEMORY_BUILD_TOOLS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON ` - -DFOONATHAN_MEMORY_BUILD_TESTS=ON -DFOONATHAN_MEMORY_BUILD_EXAMPLES=ON -DFOONATHAN_MEMORY_BUILD_TOOLS=ON ` - -DCMAKE_BUILD_TYPE=Debug -B ./build/memory ./memory - cmake --build ./build/memory --target install --verbose - - - name: Download Fast-DDS and make it sanitizer aware + - name: Install Python dependencies + uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 + with: + packages: vcstool setuptools gcovr tomark xmltodict jsondiff pandas + + - name: Get fastrtps.repos file + uses: eProsima/eProsima-CI/ubuntu/get_file_from_repo@v0 + with: + source_repository: eProsima/Fast-DDS + source_repository_branch: ${{ env.FASTDDS_BRANCH }} + file_name: fastrtps.repos + file_result: fastrtps.repos + + - name: Fetch Fast DDS & dependencies + uses: eProsima/eProsima-CI/ubuntu/vcs_import@v0 + with: + vcs_repos_file: fastrtps.repos + destination_workspace: src + + - name: Checkout Fast DDS branch run: | - cd ws - git clone https://github.com/eProsima/Fast-DDS.git - cd Fast-DDS - git fetch origin ${{ github.ref }}:merge-branch - git checkout merge-branch - echo "Modified files against destination branch" - git diff --name-only HEAD~1 - git remote add efork https://github.com/MiguelBarro/Fast-DDS.git - git fetch efork - git merge --no-edit efork/bugfix/add_sanitizer_support - - - name: Build & install Fast-DDS + cd ./src/fastrtps + git checkout ${{ env.FASTDDS_BRANCH }} + + - name: Install apt packages + uses: ./src/fastrtps/.github/actions/install-apt-packages + + - name: Install GTest + uses: eProsima/eProsima-CI/ubuntu/install_gtest@v0 + with: + version: release-1.11.0 + + - name: Build workspace run: | - cd ws - cmake -DCMAKE_PREFIX_PATH="$(pwd)/install" -DCMAKE_INSTALL_PREFIX='./install' ` - -DCMAKE_MODULE_PATH="$(pwd)/sanitizers-cmake/cmake" -DCMAKE_VERBOSE_MAKEFILE=ON -DSANITIZE_THREAD=ON ` - -DGTEST_INDIVIDUAL=ON -DFASTDDS_STATISTICS=ON -DTHIRDPARTY=ON ` - -DCOMPILE_EXAMPLES=OFF -DEPROSIMA_BUILD_TESTS=ON -DSECURITY=ON ` - -DRTPS_API_TESTS=ON -DFASTRTPS_API_TESTS=ON -DFASTDDS_PIM_API_TESTS=ON ` - -DCMAKE_BUILD_TYPE=Debug ${{ inputs.optional_cmake_args }} -B ./build/fastdds ./Fast-DDS - # Create a symlink to the reports folder - $report_dir = gci -Path ./build/fastdds -Attributes D | - ? Name -like "$(Get-Date -Format 'MMMM-dd-yyyy')*" - $report_dir = Join-Path $report_dir tsan | gi - echo "report folder is: $report_dir" - New-Item -ItemType SymbolicLink -Target $report_dir -Path ./build/fastdds/reports - cmake --build ./build/fastdds --target install -j 2 --verbose - - - name: Run Fast-DDS test & generate sanitizer reports + cat src/fastrtps/.github/workflows/config/tsan_colcon.meta + colcon build \ + --event-handlers=console_direct+ \ + --metas src/fastrtps/.github/workflows/config/tsan_colcon.meta \ + --cmake-args -DCMAKE_BUILD_TYPE=Debug ${{ inputs.optional_cmake_args }} + + - name: Run tests Fast DDS run: | - cd ws/build/fastdds - # Exclude DDSSQLFilterValueTests tests to prevent hitting GH Actions resource limits - ctest --timeout 30 -j 2 -V -E DDSSQLFilterValueTests ${{ inputs.optional_ctest_args }} - # ctest fails if sanitizer reports are present - $LASTEXITCODE=0 + source install/setup.bash && \ + colcon test \ + --packages-select fastrtps \ + --event-handlers=console_direct+ \ + --return-code-on-test-failure \ + --ctest-args \ + --timeout 30 \ + -V -E DDSSQLFilterValueTests ${{ inputs.optional_ctest_args }} + continue-on-error: true + + - name: Upload Logs + uses: actions/upload-artifact@v3 + with: + name: tsan-logs + path: log/ + if: always() - name: Process sanitizer reports id: report_summary + shell: pwsh continue-on-error: true run: | # Create a dir for the exports - $exports = New-Item -ItemType Directory -Path ./ws/exports + $exports = New-Item -ItemType Directory -Path ./exports # Move to the reports dir - pushd ./ws/build/fastdds/reports + pushd ./log/latest_test/fastrtps # Install the report parser module Find-Module -Repository PSGallery -Name SanReportParser | Install-Module -Scope CurrentUser -Force # Parse the report files - $rp = Show-Tsan (gci) + $rp = Show-Tsan -Path ./stdout_stderr.log # filter duplicates $rp = $rp | group md5hash | % { $_.group[0] } # Export raw data @@ -205,10 +179,11 @@ jobs: uses: actions/upload-artifact@v3 with: name: sanitation-report - path: /home/runner/work/ws/exports/* + path: exports/* - name: Check on failures if: ${{ steps.report_summary.outcome == 'failure' }} + shell: pwsh run: | Write-Host ${{ steps.report_summary.outcome }} exit 1 diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index c8a0c81caf..2212147b8e 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -19,14 +19,16 @@ on: description: 'Extra arguments for ctest cli' required: false type: string + fastdds_branch: + description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)' + type: string + required: true push: branches: - - 'master' + - '2.11.x' - '2.10.x' - - '2.9.x' - '2.6.x' - - '2.1.x' paths-ignore: - '**.md' - '**.txt' @@ -50,3 +52,4 @@ jobs: colcon-args: ${{ inputs.colcon-args }} cmake-args: ${{ inputs.cmake-args }} ctest-args: ${{ inputs.ctest-args }} + fastdds_branch: ${{ inputs.fastdds_branch || github.base_ref || github.ref || '2.11.x' }}