From 7643942e3988180e5fa76ea08d756511945d52e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:03:34 +0200 Subject: [PATCH] Update Fast DDS Monitor CI to use eProsima-CI utilities (#210) * Refs #21585: Migrate CI to eProsima-CI Signed-off-by: JesusPoderoso * Refs #21585: Icrease sphinx versions to avoid CI fail in ubuntu tests Signed-off-by: JesusPoderoso * Refs #21585: Update CI actions Signed-off-by: JesusPoderoso * Refs #21585: Restore python packages instead of requirements Signed-off-by: JesusPoderoso * Refs #21585: Fix windows build Signed-off-by: JesusPoderoso * Refs #21585: Set documentation as a separate job Signed-off-by: JesusPoderoso * Refs #21585: Set explicit artifact names Signed-off-by: JesusPoderoso * Refs #21585: Add mirror workflow Signed-off-by: JesusPoderoso * Refs #21585: Update branch references in fastdds_monitor.repos Signed-off-by: JesusPoderoso --------- Signed-off-by: JesusPoderoso --- .../action.yml | 10 - .../actions/install-apt-packages/action.yml | 23 - .github/actions/install-gtest/action.yml | 15 - .../install-openssl-windows/action.yml | 10 - .../Linux}/clang_colcon.meta | 0 .../Linux/colcon.meta} | 4 +- .../configurations/Windows/colcon.meta | 57 +++ .../workflows/configurations/requirements.txt | 6 - .github/workflows/mirror.yml | 24 + .github/workflows/nightly.yml | 25 + .github/workflows/reusable-workflow.yml | 271 +++++++++++ .github/workflows/test.yml | 435 ++---------------- fastdds_monitor.repos | 6 +- 13 files changed, 410 insertions(+), 476 deletions(-) delete mode 100644 .github/actions/fetch-fastdds-statistics-backend-repos/action.yml delete mode 100644 .github/actions/install-apt-packages/action.yml delete mode 100644 .github/actions/install-gtest/action.yml delete mode 100644 .github/actions/install-openssl-windows/action.yml rename .github/workflows/{ => configurations/Linux}/clang_colcon.meta (100%) rename .github/workflows/{test_colcon.meta => configurations/Linux/colcon.meta} (77%) create mode 100644 .github/workflows/configurations/Windows/colcon.meta delete mode 100644 .github/workflows/configurations/requirements.txt create mode 100644 .github/workflows/mirror.yml create mode 100644 .github/workflows/nightly.yml create mode 100644 .github/workflows/reusable-workflow.yml diff --git a/.github/actions/fetch-fastdds-statistics-backend-repos/action.yml b/.github/actions/fetch-fastdds-statistics-backend-repos/action.yml deleted file mode 100644 index 1502d2b1..00000000 --- a/.github/actions/fetch-fastdds-statistics-backend-repos/action.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: 'fetch-fastdds-statistics-backend-repos' -description: 'Fetch Fast DDS and its dependencies' -runs: - using: "composite" - steps: - - id: fetch-fastdds-statistics-backend-repos - run: | - wget https://raw.githubusercontent.com/eProsima/Fast-DDS-statistics-backend/master/fastdds_statistics_backend.repos - vcs import src < fastdds_statistics_backend.repos - shell: bash diff --git a/.github/actions/install-apt-packages/action.yml b/.github/actions/install-apt-packages/action.yml deleted file mode 100644 index de510170..00000000 --- a/.github/actions/install-apt-packages/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: 'install-apt-packages' -description: 'Install necessary apt packages' -runs: - using: "composite" - steps: - - id: install-apt-packages - run: | - sudo apt update && sudo apt -y install \ - doxygen \ - graphviz \ - imagemagick \ - python3 \ - python3-pip \ - python3-sphinxcontrib.spelling \ - python3-venv \ - software-properties-common \ - wget \ - libasio-dev \ - libtinyxml2-dev \ - clang-tidy \ - curl \ - grep - shell: bash diff --git a/.github/actions/install-gtest/action.yml b/.github/actions/install-gtest/action.yml deleted file mode 100644 index 8470e2e4..00000000 --- a/.github/actions/install-gtest/action.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Install GTest -description: Install and setup GTest for linking and building test application -runs: - using: composite - steps: - - run: sudo apt install libgtest-dev - shell: bash - - run: (cd /usr/src/gtest && sudo `which cmake` .) - shell: bash - - run: sudo make -j $(nproc) -C /usr/src/gtest - shell: bash - - run: sudo ln -s /usr/src/gtest/libgtest.a /usr/lib/libgtest.a - shell: bash - - run: sudo ln -s /usr/src/gtest/libgtest_main.a /usr/lib/libgtest_main.a - shell: bash diff --git a/.github/actions/install-openssl-windows/action.yml b/.github/actions/install-openssl-windows/action.yml deleted file mode 100644 index 964caecd..00000000 --- a/.github/actions/install-openssl-windows/action.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Install OpenSSL -description: Install and setup OpenSSL for linking and building in Windows -runs: - using: composite - steps: - - run: > - choco install openssl -yr --no-progress; - @(ls -Path C:\Windows\System32\* -Include libssl-*.dll; ls -Path C:\Windows\SysWOW64\* -Include libssl-*.dll) - | rm -ErrorAction SilentlyContinue - shell: pwsh diff --git a/.github/workflows/clang_colcon.meta b/.github/workflows/configurations/Linux/clang_colcon.meta similarity index 100% rename from .github/workflows/clang_colcon.meta rename to .github/workflows/configurations/Linux/clang_colcon.meta diff --git a/.github/workflows/test_colcon.meta b/.github/workflows/configurations/Linux/colcon.meta similarity index 77% rename from .github/workflows/test_colcon.meta rename to .github/workflows/configurations/Linux/colcon.meta index b4accff2..132daa91 100644 --- a/.github/workflows/test_colcon.meta +++ b/.github/workflows/configurations/Linux/colcon.meta @@ -12,11 +12,9 @@ { "cmake-args": [ - "-DCMAKE_BUILD_TYPE=Debug", "-DBUILD_MOCK=ON", "-DQT_PATH=$GITHUB_WORKSPACE/qt_installation/Qt/5.15.2", - "-DBUILD_DOCUMENTATION=ON", - "-DBUILD_TESTS=ON", + "-DBUILD_APP_TESTS=ON", "-DCMAKE_CXX_FLAGS='-Werror'" ] } diff --git a/.github/workflows/configurations/Windows/colcon.meta b/.github/workflows/configurations/Windows/colcon.meta new file mode 100644 index 00000000..37c72ec2 --- /dev/null +++ b/.github/workflows/configurations/Windows/colcon.meta @@ -0,0 +1,57 @@ +{ + "names": + { + "foonathan_memory": + { + "cmake-args": + [ + "-DCMAKE_CXX_FLAGS='/WX /EHsc'", + "-Ax64", + "-T host=x64", + "-DBUILD_SHARED_LIBS=OFF", + "-DFOONATHAN_MEMORY_BUILD_TOOLS=ON", + "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", + "-DFOONATHAN_MEMORY_BUILD_TESTS=OFF" + ] + }, + + "fastcdr": + { + "cmake-args": + [ + "-DCMAKE_CXX_FLAGS='/WX /EHsc'", + "-Ax64", + "-T host=x64" + ] + }, + + "fastrtps": + { + "cmake-args": + [ + "-DCMAKE_CXX_FLAGS='/WX /EHsc'", + "-Ax64", + "-T host=x64", + "-DFASTDDS_STATISTICS=ON", + "-DTHIRDPARTY=ON", + "-DSECURITY=ON", + "-DCOMPILE_EXAMPLES=OFF", + "-DEPROSIMA_BUILD_TESTS=OFF", + "-DINTERNAL_DEBUG=ON" + ] + }, + + "fastdds_monitor": + { + "cmake-args": + [ + "-DCMAKE_CXX_FLAGS='/WX /EHsc'", + "-Ax64", + "-T host=x64", + "-DBUILD_MOCK=ON", + "-DBUILD_APP_TESTS=ON", + "-DQT_PATH=$GITHUB_WORKSPACE/qt_installation/Qt/5.15.2" + ] + }, + } +} diff --git a/.github/workflows/configurations/requirements.txt b/.github/workflows/configurations/requirements.txt deleted file mode 100644 index d81e4563..00000000 --- a/.github/workflows/configurations/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -sphinx==7.3.6 -doc8==0.10.1 -sphinx_rtd_theme==2.0.0 -sphinxcontrib.spelling==8.0.0 -sphinxcontrib-imagehelper==1.1.1 -GitPython==3.1.41 diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml new file mode 100644 index 00000000..6838952b --- /dev/null +++ b/.github/workflows/mirror.yml @@ -0,0 +1,24 @@ +# .github/workflows/mirror.yml +name: Mirror +on: + push: + branches: + - 'main' + +jobs: + mirror_job: + runs-on: ubuntu-latest + name: Mirror main branch to API & ABI compatible minor version branches + strategy: + fail-fast: false + matrix: + dest_branch: + - '3.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 new file mode 100644 index 00000000..02d141b2 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,25 @@ +# Nightly test workflow for Fast DDS Monitor +name: nightly + +on: + workflow_dispatch: + schedule: + - cron: '0 5 * * *' + +jobs: + reusable_tests: + strategy: + fail-fast: false + matrix: + version: + - fastdds_ref: 'v2' + monitor_ref: '2.x' + - fastdds_ref: 'v3' + monitor_ref: 'main' + name: reusable_tests + uses: ./.github/workflows/reusable-workflow.yml + with: + custom_version_build: ${{ matrix.version.fastdds_ref }} + dependencies_artifact_postfix: '_nightly' + ref: ${{ matrix.version.monitor_ref }} + secrets: inherit diff --git a/.github/workflows/reusable-workflow.yml b/.github/workflows/reusable-workflow.yml new file mode 100644 index 00000000..ed364f3e --- /dev/null +++ b/.github/workflows/reusable-workflow.yml @@ -0,0 +1,271 @@ +name: test + +on: + + workflow_call: + inputs: + + 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 + + ref: + description: > + The branch or tag name to checkout. + required: true + type: string + default: 'main' + +env: + default_dependencies_artifact_postfix: '_nightly' + +jobs: + +##################################################################### +# TEST + + multiplatform-build: + runs-on: ${{ matrix.os.version }} + strategy: + fail-fast: false + matrix: + cmake_build_type: + - Release + - Debug + os: + - version: ubuntu-22.04 + aarch: 'gcc_64' + - version: ubuntu-24.04 + aarch: 'gcc_64' + - version: windows-2019 + aarch: 'win64_msvc2019_64' + - version: windows-2022 + aarch: 'win64_msvc2019_64' + + steps: + + - name: Sync repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: src/fastdds_monitor + ref: ${{ inputs.ref }} + + - name: Install Fast DDS dependencies + uses: eProsima/eProsima-CI/multiplatform/install_fastdds_dependencies@v0 + with: + cmake_build_type: ${{ matrix.cmake_build_type }} + + - name: Fetch Fast DDS Monitor repositories + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}//src/fastdds_monitor/fastdds_monitor.repos + destination_workspace: ${{ github.workspace }}/src + skip_existing: 'true' + + - name: Install apt packages + if: runner.os == 'Linux' + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: doxygen graphviz imagemagick python3 python3-pip python3-sphinxcontrib.spelling python3-venv software-properties-common wget curl grep + + - name: Install Ubuntu Python packages + if: ${{ runner.os == 'Linux' }} + uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 + with: + packages: sphinx==7.3.6 doc8==0.10.1 sphinx_rtd_theme==2.0.0 sphinxcontrib.spelling==8.0.0 sphinxcontrib-imagehelper==1.1.1 GitPython + + - name: Install Windows Python packages + if: ${{ runner.os == 'Windows' }} + uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 + with: + packages: sphinx doc8 sphinx_rtd_theme sphinxcontrib.spelling sphinxcontrib-imagehelper GitPython + + - name: Install Qt + uses: eProsima/eProsima-CI/external/install_qt@v0 + with: + dir: '${{ github.workspace }}/qt_installation/' + modules: 'qtcharts' + arch: ${{ matrix.os.aarch }} + setup-python: 'false' + + - name: Install OpenSSL in windows + if: runner.os == 'Windows' + shell: pwsh + run: > + choco install openssl -yr --no-progress; + @(ls -Path C:\Windows\System32\* -Include libssl-*.dll; ls -Path C:\Windows\SysWOW64\* -Include libssl-*.dll) + | rm -ErrorAction SilentlyContinue + + - name: Compile and run tests + uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@v0 + env: + QT_QPA_PLATFORM: 'offscreen' + with: + packages_names: fastdds_monitor + cmake_build_type: ${{ matrix.cmake_build_type }} + cmake_args: '-DTHIRDPARTY=ON -DBUILD_DOCUMENTATION=OFF -DBUILD_DOCUMENTATION_TESTS=OFF' + colcon_meta_file: ${{ github.workspace }}/src/fastdds_monitor/.github/workflows/configurations/${{ runner.os }}/colcon.meta + workspace: ${{ github.workspace }} + test_report_artifact: 'fastdds_monitor_${{ matrix.os.version }}_${{ matrix.cmake_build_type }}' + + - name: Upload artifact + uses: eProsima/eProsima-CI/external/upload-artifact@v0 + if: ${{ failure() }} + with: + name: ${{ matrix.os.version }}_output + path: ${{ github.workspace }}/build/fastdds_monitor + + +##################################################################### +# DOCUMENTATION + +##################################################################### +# TEST + + documentation: + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + cmake_build_type: + - Release + - Debug + + steps: + - name: Sync repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: src/fastdds_monitor + ref: ${{ inputs.ref }} + + - name: Install Fast DDS dependencies + uses: eProsima/eProsima-CI/multiplatform/install_fastdds_dependencies@v0 + with: + cmake_build_type: ${{ matrix.cmake_build_type }} + + - name: Fetch Fast DDS Monitor repositories + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}//src/fastdds_monitor/fastdds_monitor.repos + destination_workspace: ${{ github.workspace }}/src + skip_existing: 'true' + + - name: Install apt packages + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: doxygen graphviz imagemagick python3 python3-pip python3-sphinxcontrib.spelling python3-venv software-properties-common wget curl grep + + - name: Install Python packages + uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 + with: + packages: sphinx==7.3.6 doc8==0.10.1 sphinx_rtd_theme==2.0.0 sphinxcontrib.spelling==8.0.0 sphinxcontrib-imagehelper==1.1.1 GitPython + + - name: Install Qt + uses: eProsima/eProsima-CI/external/install_qt@v0 + with: + dir: '${{ github.workspace }}/qt_installation/' + modules: 'qtcharts' + setup-python: 'false' + + - name: Compile and run tests + uses: eProsima/eProsima-CI/multiplatform/colcon_build_test@v0 + with: + packages_names: fastdds_monitor + cmake_build_type: ${{ matrix.cmake_build_type }} + cmake_args: '-DTHIRDPARTY=ON -DBUILD_DOCUMENTATION=ON -DBUILD_DOCUMENTATION_TESTS=ON' + colcon_meta_file: ${{ github.workspace }}/src/fastdds_monitor/.github/workflows/configurations/Linux/colcon.meta + workspace: ${{ github.workspace }} + test_report_artifact: 'fastdds_monitor_documentation' + + +##################################################################### +# CLANG + + clang: + runs-on: ubuntu-22.04 + steps: + + - name: Sync repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: ${{ github.workspace }}/src/fastdds_monitor + ref: ${{ inputs.ref }} + + - name: Install Fast DDS dependencies + uses: eProsima/eProsima-CI/multiplatform/install_fastdds_dependencies@v0 + with: + cmake_build_type: ${{ matrix.cmake_build_type }} + + - name: Fetch Fast DDS Monitor repositories + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}/src/fastdds_monitor/fastdds_monitor.repos + destination_workspace: ${{ github.workspace }}/src + skip_existing: 'true' + + - name: Install apt packages + if: runner.os == 'Linux' + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: doxygen graphviz imagemagick python3 python3-pip python3-sphinxcontrib.spelling python3-venv software-properties-common wget curl grep + + - name: Install Python packages + uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 + with: + packages: sphinx==7.3.6 doc8==0.10.1 sphinx_rtd_theme==2.0.0 sphinxcontrib.spelling==8.0.0 sphinxcontrib-imagehelper==1.1.1 GitPython + + - name: Install Qt + uses: eProsima/eProsima-CI/external/install_qt@v0 + with: + dir: '${{ github.workspace }}/qt_installation/' + modules: 'qtcharts' + setup-python: 'false' + + - name: Install OpenSSL in windows + if: runner.os == 'Windows' + shell: pwsh + run: > + choco install openssl -yr --no-progress; + @(ls -Path C:\Windows\System32\* -Include libssl-*.dll; ls -Path C:\Windows\SysWOW64\* -Include libssl-*.dll) + | rm -ErrorAction SilentlyContinue + + - name: Compile and run tests + uses: eProsima/eProsima-CI/multiplatform/clang_build_test@v0 + with: + packages_names: fastdds_monitor + colcon_meta_file: ${{ github.workspace }}/src/fastdds_monitor/.github/workflows/configurations/Linux/clang_colcon.meta + workspace: ${{ github.workspace }} + + - name: Upload artifact + uses: eProsima/eProsima-CI/external/upload-artifact@v0 + if: ${{ failure() }} + with: + name: clang_output + path: ${{ github.workspace }}/build/fastdds_monitor + +##################################################################### +# UNCRUSTIFY + + uncrustify: + runs-on: ubuntu-22.04 + steps: + + - name: Sync repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: src + ref: ${{ inputs.ref }} + + - name: Uncrustify + uses: eProsima/eProsima-CI/ubuntu/uncrustify@v0 + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da6f883d..aeb783ea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,417 +1,40 @@ +# 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 + type: string + default: '_nightly' + pull_request: push: branches: - main - schedule: - - cron: '0 0 * * *' jobs: - windows-build-test-release: - runs-on: windows-latest - environment: - name: codecov - env: - CXXFLAGS: /MP - OPENSSL64_ROOT: "C:/Program Files/OpenSSL-Win64" - - steps: - - uses: actions/checkout@v2 - with: - path: Fast-DDS-monitor - - - name: Install OpenSSL - uses: ./Fast-DDS-monitor/.github/actions/install-openssl-windows - - - name: Install GoogleTest - shell: pwsh - run: > - cmake --find-package -DNAME=GTest -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST | Tee-Object -Variable res; - if ( $res -notlike '*GTest found.*') - { - git clone https://github.com/google/googletest.git; - cmake -DCMAKE_INSTALL_PREFIX='C:\Program Files\gtest' -Dgtest_force_shared_crt=ON -DBUILD_GMOCK=ON ` - -B build\gtest -A x64 -T host=x64 googletest; - cmake --build build\gtest --config Release --target install - } - - - name: Install Qt - uses: jurplel/install-qt-action@v2.13.0 - with: - version: '5.15.2' - arch: 'win64_msvc2019_64' - dir: '${{ github.workspace }}/qt_installation/' - modules: 'qtcharts' - - - name: Install foonatham memory - shell: pwsh - run: > - git clone --recurse-submodules --branch v0.6-2 https://github.com/foonathan/memory.git; - cmake -DBUILD_SHARED_LIBS=OFF -DFOONATHAN_MEMORY_BUILD_TOOLS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON ` - -DFOONATHAN_MEMORY_BUILD_TESTS=OFF -Ax64 -T host=x64 -B build\memory memory; - cmake --build build\memory --config Release --target install - - - name: install Fast-CDR - shell: pwsh - run: > - git clone https://github.com/eProsima/Fast-CDR.git; - cmake -Ax64 -T host=x64 -B build\fastcdr Fast-CDR; - cmake --build build\fastcdr --config Release --target install - - - name: Install Fast-DDS - shell: pwsh - run: > - git clone https://github.com/eProsima/Fast-DDS.git; - cmake -DTHIRDPARTY=ON -DSECURITY=ON -DCOMPILE_EXAMPLES=OFF -DEPROSIMA_BUILD_TESTS=OFF ` - -DINTERNAL_DEBUG=ON -Ax64 -T host=x64 -B build\fastdds Fast-DDS; - cmake --build build\fastdds --config Release --target install - - - name: Install Fast-DDS-statistics-backend - shell: pwsh - run: > - git clone https://github.com/eProsima/Fast-DDS-statistics-backend.git; - cmake -DCMAKE_PREFIX_PATH='C:\Program Files\gtest' ` - -B build\backend -A x64 -T host=x64 Fast-DDS-statistics-backend; - cmake --build build\backend --config Release --target install - - - name: Install Fast-DDS-monitor - shell: pwsh - run: > - cmake -DCMAKE_PREFIX_PATH='C:\Program Files\gtest' -DBUILD_APP_TESTS=ON -DBUILD_MOCK=ON ` - -DQT_PATH=$GITHUB_WORKSPACE/qt_installation/Qt/5.15.2 -DCMAKE_CXX_FLAGS="/WX /EHsc" ` - -B build\monitor -A x64 -T host=x64 Fast-DDS-monitor; - cmake --build build\monitor --config Release --target install - - - name: Run tests - shell: pwsh - run: ctest -C Release --test-dir build\monitor -V --timeout 60 - - windows-build-test-debug: - runs-on: windows-latest - environment: - name: codecov - env: - CXXFLAGS: /MP - OPENSSL64_ROOT: "C:/Program Files/OpenSSL-Win64" - - steps: - - uses: actions/checkout@v2 - with: - path: Fast-DDS-monitor - - - name: Install OpenSSL - uses: ./Fast-DDS-monitor/.github/actions/install-openssl-windows - - - name: Install GoogleTest - shell: pwsh - run: > - cmake --find-package -DNAME=GTest -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST | Tee-Object -Variable res; - if ( $res -notlike '*GTest found.*') - { - git clone https://github.com/google/googletest.git; - cmake -DCMAKE_INSTALL_PREFIX='C:\Program Files\gtest' -Dgtest_force_shared_crt=ON -DBUILD_GMOCK=ON ` - -B build\gtest -A x64 -T host=x64 googletest; - cmake --build build\gtest --config Debug --target install - } - - - name: Install Qt - uses: jurplel/install-qt-action@v2.13.0 - with: - version: '5.15.2' - arch: 'win64_msvc2019_64' - dir: '${{ github.workspace }}/qt_installation/' - modules: 'qtcharts' - - - name: Install foonatham memory - shell: pwsh - run: > - git clone --recurse-submodules --branch v0.6-2 https://github.com/foonathan/memory.git; - cmake -DBUILD_SHARED_LIBS=OFF -DFOONATHAN_MEMORY_BUILD_TOOLS=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON ` - -DFOONATHAN_MEMORY_BUILD_TESTS=OFF -Ax64 -T host=x64 -B build\memory memory; - cmake --build build\memory --config Debug --target install - - - name: install Fast-CDR - shell: pwsh - run: > - git clone https://github.com/eProsima/Fast-CDR.git; - cmake -Ax64 -T host=x64 -B build\fastcdr Fast-CDR; - cmake --build build\fastcdr --config Debug --target install - - - name: Install Fast-DDS - shell: pwsh - run: > - git clone https://github.com/eProsima/Fast-DDS.git; - cmake -DTHIRDPARTY=ON -DSECURITY=ON -DCOMPILE_EXAMPLES=OFF -DEPROSIMA_BUILD_TESTS=OFF ` - -DINTERNAL_DEBUG=ON -Ax64 -T host=x64 -B build\fastdds Fast-DDS; - cmake --build build\fastdds --config Debug --target install - - - name: Install Fast-DDS-statistics-backend - shell: pwsh - run: > - git clone https://github.com/eProsima/Fast-DDS-statistics-backend.git; - cmake -DCMAKE_PREFIX_PATH='C:\Program Files\gtest' ` - -B build\backend -A x64 -T host=x64 Fast-DDS-statistics-backend; - cmake --build build\backend --config Debug --target install - - - name: Install Fast-DDS-monitor - shell: pwsh - run: > - cmake -DCMAKE_PREFIX_PATH='C:\Program Files\gtest' -DBUILD_APP_TESTS=ON -DBUILD_MOCK=ON ` - -DQT_PATH=$GITHUB_WORKSPACE/qt_installation/Qt/5.15.2 -DCMAKE_CXX_FLAGS="/WX /EHsc" ` - -B build\monitor -A x64 -T host=x64 Fast-DDS-monitor; - cmake --build build\monitor --config Debug --target install - - - name: Run tests - shell: pwsh - run: ctest -C Debug --test-dir build\monitor -V --timeout 60 - - ubuntu-build-test: - runs-on: ubuntu-latest - environment: - name: codecov - - steps: - - uses: actions/checkout@v2 - with: - path: src/Fast-DDS-monitor - - - name: Install apt packages - uses: ./src/Fast-DDS-monitor/.github/actions/install-apt-packages - - - name: Install GTest - uses: ./src/Fast-DDS-monitor/.github/actions/install-gtest - - - name: Install colcon - uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 - - - name: Install Python packages - uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 - with: - packages: \ - sphinx==3.0.3 \ - doc8==0.8.0 \ - sphinx_rtd_theme==0.4.3 \ - sphinxcontrib.spelling==5.0.0 \ - sphinxcontrib-imagehelper==1.1.1 \ - vcstool \ - GitPython \ - setuptools \ - gcovr==5 - - - name: Fetch Fast DDS Statistics Backend repositories - uses: ./src/Fast-DDS-monitor/.github/actions/fetch-fastdds-statistics-backend-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: Install Qt - uses: jurplel/install-qt-action@v2.13.0 - with: - version: '5.15.2' - dir: '${{ github.workspace }}/qt_installation/' - modules: 'qtcharts' - - - name: Build workspace - run: | - cat src/Fast-DDS-monitor/.github/workflows/test_colcon.meta - colcon build \ - --event-handlers=console_direct+ \ - --metas src/Fast-DDS-monitor/.github/workflows/test_colcon.meta \ - --mixin coverage-gcc asan-gcc - - - name: Run tests - run: | - source install/setup.bash && \ - QT_QPA_PLATFORM=offscreen \ - colcon test \ - --packages-select fastdds_monitor \ - --event-handlers=console_direct+ \ - --return-code-on-test-failure - - - name: Generate coverage report - run: | - cp src/Fast-DDS-monitor/codecov.yml . - mkdir coverage-report - gcovr \ - --root src/Fast-DDS-monitor/ \ - --object-directory build/fastdds_monitor \ - --output coverage-report/coverage.xml \ - --xml-pretty \ - --exclude='.*docs/.*' \ - --exclude='.*test/.*' \ - --exclude='.*mock/.*' \ - --exclude='.*github/.*' \ - --exclude-unreachable-branches - - - name: Upload coverage - uses: actions/upload-artifact@v1 - with: - name: coverage-report - path: coverage-report/ - - - name: Upload documentation - uses: actions/upload-artifact@v1 - with: - name: Documentation HTML - path: install/fastdds_monitor/docs/fastdds_monitor_docs/sphinx/html/ - - - 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-monitor - fail_ci_if_error: true - - - name: Upload Logs - uses: actions/upload-artifact@v1 - with: - name: colcon-logs-ubuntu - path: log/ - if: always() - - - name: Upload spelling errors - uses: actions/upload-artifact@v1 - with: - name: spelling_errors.txt - path: build/fastdds_monitor/docs/test/spelling/output.txt - continue-on-error: true - - clang-tidy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - path: src/Fast-DDS-monitor - - - uses: ./src/Fast-DDS-monitor/.github/actions/install-apt-packages - - uses: ./src/Fast-DDS-monitor/.github/actions/install-gtest - - uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 - - uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 - with: - packages: \ - sphinx==3.0.3 \ - doc8==0.8.0 \ - sphinx_rtd_theme==0.4.3 \ - sphinxcontrib.spelling==5.0.0 \ - sphinxcontrib-imagehelper==1.1.1 \ - vcstool \ - GitPython \ - setuptools \ - gcovr==5 - - uses: ./src/Fast-DDS-monitor/.github/actions/fetch-fastdds-statistics-backend-repos - - - name: Install Qt - uses: jurplel/install-qt-action@v2.13.0 - with: - version: '5.15.2' - dir: '${{ github.workspace }}/qt_installation/' - modules: 'qtcharts' - - - name: Build workspace - run: | - cat src/Fast-DDS-monitor/.github/workflows/clang_colcon.meta - colcon build \ - --event-handlers=console_direct+ \ - --metas src/Fast-DDS-monitor/.github/workflows/clang_colcon.meta - - - name: Run clang-tidy - run: | - cd build/fastdds_monitor - run-clang-tidy -header-filter='.*' -checks='clang-analyzer-cplusplus' -quiet 2> ${{ github.workspace }}/clang_results.yml - - - name: Upload clang results - uses: actions/upload-artifact@v1 - with: - name: clang_results - path: ${{ github.workspace }}/clang_results.yml - - uncrustify: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - path: src/Fast-DDS-monitor - - - name: Fetch all branches and tags - run: | - cd src/Fast-DDS-monitor - git fetch --prune --unshallow - - - uses: ./src/Fast-DDS-monitor/.github/actions/install-apt-packages - - uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 - - uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0 - with: - packages: \ - sphinx==3.0.3 \ - doc8==0.8.0 \ - sphinx_rtd_theme==0.4.3 \ - sphinxcontrib.spelling==5.0.0 \ - sphinxcontrib-imagehelper==1.1.1 \ - vcstool \ - GitPython \ - setuptools \ - gcovr==5 - - - name: Install uncrustify - run: | - git clone https://github.com/uncrustify/uncrustify.git \ - --branch uncrustify-0.71.0 \ - --single-branch uncrustify - mkdir -p uncrustify/build - cd uncrustify/build - cmake .. - sudo cmake --build . --target install - cd ../.. - sudo rm -rf uncrustify - - - name: Clone ament_lint - run: | - git clone https://github.com/ament/ament_lint.git src/ament_lint - - - name: Build ament_uncrustify - run: colcon build --packages-up-to ament_uncrustify - - - name: Fetch uncrustify config file - run: | - curl \ - -l https://raw.githubusercontent.com/eProsima/cpp-style/master/uncrustify.cfg \ - -o uncrustify.cfg - - - name: Get difference - run: | - cd src/Fast-DDS-monitor - echo "MODIFIED_FILES=$(git diff --name-only origin/${GITHUB_BASE_REF} origin/${GITHUB_HEAD_REF} | grep -e '\.h' -e '\.hpp' -e '\.cpp' -e '\.ipp' | tr '\n' ' ')" >> $GITHUB_ENV - - - name: Check difference - run: | - cd src/Fast-DDS-monitor - if [[ -z "${MODIFIED_FILES}" ]] - then - touch empty.hpp - echo "MODIFIED_FILES=empty.hpp" >> $GITHUB_ENV - fi - - - name: Check style - run: | - source install/local_setup.bash - cd src/Fast-DDS-monitor - ament_uncrustify \ - -c ../../uncrustify.cfg \ - --language CPP \ - --xunit-file ../../uncrustify_results.xml \ - ${MODIFIED_FILES} - - - name: Upload uncrustify results - uses: actions/upload-artifact@v1 - with: - name: uncrustify_results - path: uncrustify_results.xml + reusable_tests: + name: reusable_tests + uses: ./.github/workflows/reusable-workflow.yml + with: + custom_version_build: ${{ inputs.custom_version_build || 'v3' }} + dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix || '_nightly' }} + ref: ${{ github.ref }} + secrets: inherit diff --git a/fastdds_monitor.repos b/fastdds_monitor.repos index 6c275519..41bfc8f0 100644 --- a/fastdds_monitor.repos +++ b/fastdds_monitor.repos @@ -6,15 +6,15 @@ repositories: fastcdr: type: git url: https://github.com/eProsima/Fast-CDR.git - version: master + version: 2.x fastdds: type: git url: https://github.com/eProsima/Fast-DDS.git - version: master + version: 3.x fastdds_statistics_backend: type: git url: https://github.com/eProsima/Fast-DDS-statistics-backend.git - version: main + version: 2.x fastdds_monitor: type: git url: https://github.com/eProsima/Fast-DDS-monitor.git