From 16fd4936e8e8e4ca8dd192c276de00aff0d14ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Poderoso?= <120394830+JesusPoderoso@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:09:59 +0200 Subject: [PATCH] Improve CI workflows in 1.4.x, and branching model refactor (#149) (#150) * Refs #21228: Refactor Ubuntu CI Signed-off-by: JesusPoderoso * Refs #21228: Refactor Windows CI Signed-off-by: JesusPoderoso * Refs #21228: Remove previous workflow Signed-off-by: JesusPoderoso * Refs #21228: Add RELEASE_SUPPORT.md with Fast DDS references Signed-off-by: JesusPoderoso * Refs #21228: Fix windows CI removing win2017 Signed-off-by: JesusPoderoso * Refs #21228: Apply rev suggestions in main PR Signed-off-by: JesusPoderoso * Refs #21228: Avoid building dependencies again Signed-off-by: JesusPoderoso * Refs #21228: Apply rev suggestions Signed-off-by: JesusPoderoso * Refs #21228: Apply rev suggestions Signed-off-by: JesusPoderoso --------- Signed-off-by: JesusPoderoso --- .../fetch-fastdds_python-repos/action.yml | 23 -- .github/workflows/build_and_test.yml | 230 --------------- .github/workflows/config/build.meta | 5 + .github/workflows/config/ubuntu_test.meta | 10 + .github/workflows/config/windows_test.meta | 9 + .github/workflows/reusable-ubuntu-ci.yml | 226 ++++++++++++++ .github/workflows/reusable-windows-ci.yml | 276 ++++++++++++++++++ .github/workflows/test.meta | 17 -- .github/workflows/ubuntu-ci.yml | 75 +++++ .github/workflows/windows-ci.yml | 79 +++++ README.md | 2 + RELEASE_SUPPORT.md | 3 + fastdds_python.repos | 2 +- 13 files changed, 686 insertions(+), 271 deletions(-) delete mode 100644 .github/actions/fetch-fastdds_python-repos/action.yml delete mode 100644 .github/workflows/build_and_test.yml create mode 100644 .github/workflows/config/build.meta create mode 100644 .github/workflows/config/ubuntu_test.meta create mode 100644 .github/workflows/config/windows_test.meta create mode 100644 .github/workflows/reusable-ubuntu-ci.yml create mode 100644 .github/workflows/reusable-windows-ci.yml delete mode 100644 .github/workflows/test.meta create mode 100644 .github/workflows/ubuntu-ci.yml create mode 100644 .github/workflows/windows-ci.yml create mode 100644 RELEASE_SUPPORT.md diff --git a/.github/actions/fetch-fastdds_python-repos/action.yml b/.github/actions/fetch-fastdds_python-repos/action.yml deleted file mode 100644 index 145def23..00000000 --- a/.github/actions/fetch-fastdds_python-repos/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: 'fetch-fastdds_python-repos' -description: 'Fetch Fast DDS Python dependencies' -inputs: - foonathan-memory-vendor-branch: - description: 'foonathan_memory_vendor branch to be used' - required: true - fastcdr-branch: - description: 'Fast-CDR branch to be used' - required: true - fastdds-branch: - description: 'Fast-DDS branch to be used' - required: true -runs: - using: "composite" - steps: - - id: fetch-fastdds_python-repos - shell: bash - run: | - cd src - git clone https://github.com/eProsima/foonathan_memory_vendor.git --branch ${{ inputs.foonathan-memory-vendor-branch }} - git clone https://github.com/eProsima/Fast-CDR.git --branch ${{ inputs.fastcdr-branch }} - git clone https://github.com/eProsima/Fast-DDS.git --branch ${{ inputs.fastdds-branch }} - cd .. diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml deleted file mode 100644 index 14537e5d..00000000 --- a/.github/workflows/build_and_test.yml +++ /dev/null @@ -1,230 +0,0 @@ -name: test - -on: - workflow_dispatch: - inputs: - foonathan_memory_vendor_branch: - description: 'foonathan_memory_vendor branch to be used' - required: false - default: 'master' - fastcdr_versions: - description: 'Fast CDR branches to be used' - required: false - default: '["1.1.x", "master"]' - fastdds_branch: - description: 'Fast DDS branch to be used' - required: false - default: '2.14.x' - pull_request: - push: - branches: - - 1.4.x - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - windows-build-test: - runs-on: windows-2019 - strategy: - fail-fast: false - matrix: - foonathan_memory_vendor_version: - - ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }} - fastcdr_version: ${{ fromJson(github.event.inputs.fastcdr_versions || '["1.1.x", "master"]') }} - fastdds_version: - - ${{ github.event.inputs.fastdds_branch || '2.14.x' }} - - env: - CXXFLAGS: /MP - OPENSSL64_ROOT: "C:/Program Files/OpenSSL-Win64" - - steps: - - - uses: eProsima/eprosima-CI/windows/install_openssl@v0 - with: - version: '3.1.1' - - - name: Install Asio and TinyXML2 - shell: pwsh - run: | - mkdir "$pwdpath/choco_packages" - Invoke-WebRequest -Uri https://github.com/ros2/choco-packages/releases/download/2020-02-24/asio.1.12.1.nupkg -OutFile "$pwdpath/choco_packages/asio.1.12.1.nupkg" - Invoke-WebRequest -Uri https://github.com/ros2/choco-packages/releases/download/2020-02-24/tinyxml2.6.0.0.nupkg -OutFile "$pwdpath/choco_packages/tinyxml2.6.0.0.nupkg" - choco install -y -s "$pwdpath/choco_packages" asio tinyxml2 - Set-Item -Force -Path "env:PATH" -Value "C:\ProgramData\chocolatey\lib\asio;C:\ProgramData\chocolatey\lib\tinyxml2;C:\ProgramData\chocolatey\lib\tinyxml2\lib;$env:PATH" - echo "PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - - name: Install swig - shell: pwsh - run: choco install swig --allow-downgrade --version=4.0.2.04082020 - - - name: Setup Python version - uses: eProsima/eProsima-CI/external/setup-python@v0 - with: - python-version: '3.11' - - - name: Install Python dependencies - uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 - with: - packages: pytest pywin32 - - - name: Install colcon - uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0 - - - name: Checkout Fast DDS Python - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: src/fastdds_python - - - name: Checkout foonathan memory vendor - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - repository: eProsima/foonathan_memory_vendor - path: src/foonathan_memory_vendor - ref: ${{ matrix.foonathan_memory_vendor_version }} - - - name: Checkout Fast CDR - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - repository: eProsima/Fast-CDR - path: src/fastcdr - ref: ${{ matrix.fastcdr_version }} - - - name: Checkout Fast DDS - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - repository: eProsima/Fast-DDS - path: src/fastdds - ref: ${{ matrix.fastdds_version }} - - - name: Setup CMake version - uses: eProsima/eProsima-CI/external/get-cmake@v0 - with: - cmakeVersion: 3.22.6 - - - name: Setting ninja - id: ninja - if: github.event.schedule == '' - shell: pwsh - run: | - echo "cmake_generator=ninja" >> $Env:GITHUB_OUTPUT - - - name: Setup ccache - uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 - with: - windows_compile_environment: msvc - api_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Build workspace - uses: eProsima/eProsima-CI/windows/colcon_build@v0 - with: - colcon_meta_file: ./src/fastdds_python/.github/workflows/test.meta - colcon_build_args: --executor parallel --mixin ccache ${{ steps.ninja.outputs.cmake_generator }} - colcon_build_args_default: --event-handlers console_direct+ desktop_notification- - cmake_build_type: RelWithDebInfo - cmake_args_default: ' ' - workspace: ${{ github.workspace }} - - - name: Run tests - id: test - uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 - with: - colcon_test_args: --return-code-on-test-failure - colcon_test_args_default: --event-handlers console_direct+ desktop_notification- - ctest_args_default: --timeout 60 - packages_names: fastdds_python - workspace: ${{ github.workspace }} - workspace_dependencies: ${{ github.workspace }} - - - name: Upload Logs - uses: actions/upload-artifact@v1 - with: - name: colcon-logs-windows - path: log/ - if: always() - - ubuntu-build-test: - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - foonathan_memory_vendor_version: - - ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }} - fastcdr_version: ${{ fromJson(github.event.inputs.fastcdr_versions || '["1.1.x", "master"]') }} - fastdds_version: - - ${{ github.event.inputs.fastdds_branch || '2.14.x' }} - - - steps: - - name: Checkout Fast DDS Python - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - path: src/fastdds_python - - - name: Install apt dependencies - uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 - with: - packages: libasio-dev libtinyxml2-dev libpython3-dev swig - - - name: Install colcon - uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0 - - - name: Checkout foonathan memory vendor - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - repository: eProsima/foonathan_memory_vendor - path: src/foonathan_memory_vendor - ref: ${{ matrix.foonathan_memory_vendor_version }} - - - name: Checkout Fast CDR - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - repository: eProsima/Fast-CDR - path: src/fastcdr - ref: ${{ matrix.fastcdr_version }} - - - name: Checkout Fast DDS - uses: eProsima/eProsima-CI/external/checkout@v0 - with: - repository: eProsima/Fast-DDS - path: src/fastdds - ref: ${{ matrix.fastdds_version }} - - - name: Setup CMake version - uses: eProsima/eProsima-CI/external/get-cmake@v0 - with: - cmakeVersion: 3.22.6 - - - name: Setup ccache - uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 - with: - api_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Build workspace - uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 - with: - colcon_meta_file: ./src/fastdds_python/.github/workflows/test.meta - colcon_build_args: --executor parallel --mixin ccache - colcon_build_args_default: --event-handlers console_direct+ - cmake_build_type: RelWithDebInfo - cmake_args_default: '' - workspace: ${{ github.workspace }} - - - name: Run tests - id: test - uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 - with: - colcon_test_args: --return-code-on-test-failure - colcon_test_args_default: --event-handlers console_direct+ - ctest_args_default: --timeout 60 - packages_names: fastdds_python - workspace: ${{ github.workspace }} - - - name: Upload Logs - uses: actions/upload-artifact@v1 - with: - name: colcon-logs-ubuntu - path: log/ - if: always() diff --git a/.github/workflows/config/build.meta b/.github/workflows/config/build.meta new file mode 100644 index 00000000..20de57d7 --- /dev/null +++ b/.github/workflows/config/build.meta @@ -0,0 +1,5 @@ +names: + fastdds: + cmake-args: + - "-DSECURITY=ON" + - "-DLOG_CONSUMER_DEFAULT=STDOUT" diff --git a/.github/workflows/config/ubuntu_test.meta b/.github/workflows/config/ubuntu_test.meta new file mode 100644 index 00000000..a96a78ea --- /dev/null +++ b/.github/workflows/config/ubuntu_test.meta @@ -0,0 +1,10 @@ +names: + fastdds_python: + cmake-args: + - "-DBUILD_TESTING=ON" + - "-DBUILD_DOCUMENTATION=ON" + ctest-args: [ + "--repeat", "until-pass:3", + "--timeout", "300", + "--label-exclude", "xfail" + ] diff --git a/.github/workflows/config/windows_test.meta b/.github/workflows/config/windows_test.meta new file mode 100644 index 00000000..bb759e45 --- /dev/null +++ b/.github/workflows/config/windows_test.meta @@ -0,0 +1,9 @@ +names: + fastdds_python: + cmake-args: + - "-DBUILD_TESTING=ON" + ctest-args: [ + "--repeat", "until-pass:3", + "--timeout", "300", + "--label-exclude", "xfail" + ] diff --git a/.github/workflows/reusable-ubuntu-ci.yml b/.github/workflows/reusable-ubuntu-ci.yml new file mode 100644 index 00000000..31779496 --- /dev/null +++ b/.github/workflows/reusable-ubuntu-ci.yml @@ -0,0 +1,226 @@ +name: Fast DDS Python Ubuntu CI reusable workflow + +on: + workflow_call: + inputs: + os-version: + description: 'The OS image for the workflow' + required: false + default: 'ubuntu-22.04' + type: string + label: + description: 'ID associated to the workflow' + required: true + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastdds-python-branch: + description: 'Branch or tag of Fast DDS Python repository' + required: true + type: string + fastdds-branch: + description: 'Branch or tag of Fast DDS repository' + required: true + type: string + run-build: + description: 'Build Fast DDS Python (CI skipped otherwise)' + required: false + type: boolean + default: true + run-tests: + description: 'Run test suite of Fast DDS python' + required: false + type: boolean + default: true + use-ccache: + description: 'Use CCache to speed up the build' + required: false + type: boolean + default: false + +defaults: + run: + shell: bash + +jobs: + fastdds_python_build: + runs-on: ${{ inputs.os-version }} + if: ${{ inputs.run-build == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Add ci-pending label if PR + if: ${{ github.event_name == 'pull_request' }} + uses: eProsima/eProsima-CI/external/add_labels@v0 + with: + labels: ci-pending + number: ${{ github.event.number }} + repo: eProsima/Fast-DDS-Python + + - name: Sync eProsima/Fast-DDS-Python repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: src/fastdds_python + ref: ${{ inputs.fastdds-python-branch }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install apt dependencies + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: libasio-dev libtinyxml2-dev libssl-dev swig doxygen + update: false + upgrade: false + + - name: Install colcon + uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0 + + - name: Install Python dependencies + uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 + with: + packages: vcstool xmlschema + upgrade: false + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Get Fast DDS branch + id: get_fastdds_branch + uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0 + with: + remote_repository: eProsima/Fast-DDS + fallback_branch: ${{ inputs.fastdds-branch }} + + - name: Download Fast DDS repo + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + repository: eProsima/Fast-DDS + path: src/fastdds + ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }} + + - name: Fetch Fast DDS Python dependencies + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}/src/fastdds_python/fastdds_python.repos + destination_workspace: src + skip_existing: 'true' + + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta + colcon_build_args: ${{ inputs.colcon-args }} + cmake_args: ${{ inputs.cmake-args }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Upload build artifacts + uses: eProsima/eProsima-CI/external/upload-artifact@v0 + with: + name: fastdds_python_build_${{ inputs.label }} + path: ${{ github.workspace }} + + fastdds_python_test: + needs: fastdds_python_build + runs-on: ${{ inputs.os-version }} + if: ${{ inputs.run-tests == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Download python build artifacts + uses: eProsima/eProsima-CI/external/download-artifact@v0 + with: + name: fastdds_python_build_${{ inputs.label }} + path: ${{ github.workspace }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install apt packages + uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: libasio-dev libtinyxml2-dev libssl-dev swig + + - 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: xmlschema pytest + + - name: Setup CCache + uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} + with: + api_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/ubuntu_test.meta + colcon_build_args: ${{ inputs.colcon-args }} + colcon_build_args_default: '--packages-select fastdds_python' + cmake_args: ${{ inputs.cmake-args }} + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + workspace_dependencies: ${{ github.workspace }}/install + + - name: Colcon test + id: python_test + uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/ubuntu_test.meta + colcon_test_args: ${{ inputs.colcon-args }} + colcon_test_args_default: --event-handlers=console_direct+ + ctest_args: ${{ inputs.ctest-args }} + packages_names: fastdds_python + workspace: ${{ github.workspace }} + workspace_dependencies: '' + test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} + + - name: Fast DDS Python test summary + uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 + if: ${{ !cancelled() }} + with: + junit_reports_dir: "${{ steps.python_test.outputs.ctest_results_path }}" + print_summary: 'True' + show_failed: 'True' + show_disabled: 'False' + show_skipped: 'False' diff --git a/.github/workflows/reusable-windows-ci.yml b/.github/workflows/reusable-windows-ci.yml new file mode 100644 index 00000000..ecdb26af --- /dev/null +++ b/.github/workflows/reusable-windows-ci.yml @@ -0,0 +1,276 @@ +name: Fast DDS Python Windows CI reusable workflow + +on: + workflow_call: + inputs: + os-version: + description: 'The OS image for the workflow' + required: false + default: 'windows-2019' + type: string + vs-toolset: + description: 'The VS toolset to use for the build' + required: false + default: 'v142' + type: string + label: + description: 'ID associated to the workflow' + required: true + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastdds-python-branch: + description: 'Branch or tag of Fast DDS Python repository' + required: true + type: string + fastdds-branch: + description: 'Branch or tag of Fast DDS repository' + required: true + type: string + run-build: + description: 'Build Fast DDS Python (CI skipped otherwise)' + required: false + type: boolean + default: true + run-tests: + description: 'Run test suite of Fast DDS python' + required: false + type: boolean + default: true +env: + colcon-build-default-cmake-args: '-DTHIRDPARTY_Asio=FORCE -DTHIRDPARTY_TinyXML2=FORCE -DTHIRDPARTY_fastcdr=OFF -DTHIRDPARTY_UPDATE=ON -DEPROSIMA_EXTRA_CMAKE_CXX_FLAGS="/MP /WX"' +defaults: + run: + shell: pwsh + +jobs: + fastdds_python_build: + runs-on: ${{ inputs.os-version }} + if: ${{ inputs.run-build == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + + steps: + - name: Add ci-pending label if PR + if: ${{ github.event_name == 'pull_request' }} + uses: eProsima/eProsima-CI/external/add_labels@v0 + with: + labels: ci-pending + number: ${{ github.event.number }} + repo: eProsima/Fast-DDS-Python + + - name: Sync eProsima/Fast-DDS-Python repository + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + path: src/fastdds_python + ref: ${{ inputs.fastdds-python-branch }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install OpenSSL + uses: eProsima/eprosima-CI/windows/install_openssl@v0 + with: + version: '3.1.1' + + - name: Update OpenSSL environment variables + run: | + # 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 pywin32 + + - name: Install swig + shell: pwsh + run: choco install swig --allow-downgrade --version=4.0.2.04082020 + + - name: Get Fast DDS branch + id: get_fastdds_branch + uses: eProsima/eProsima-CI/multiplatform/get_related_branch_from_repo@v0 + with: + remote_repository: eProsima/Fast-DDS + fallback_branch: ${{ inputs.fastdds-branch }} + + - name: Download Fast DDS repo + uses: eProsima/eProsima-CI/external/checkout@v0 + with: + repository: eProsima/Fast-DDS + path: src/fastdds + ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }} + + - name: Fetch Fast DDS Python dependencies + uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0 + with: + vcs_repos_file: ${{ github.workspace }}/src/fastdds_python/fastdds_python.repos + destination_workspace: src + skip_existing: 'true' + + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta + colcon_build_args: ${{ inputs.colcon-args }} + colcon_build_args_default: --event-handlers console_direct+ + cmake_args: ${{ inputs.cmake-args }} + cmake_args_default: '-T ${{ inputs.vs-toolset }} ${{ env.colcon-build-default-cmake-args }}' + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + + - name: Upload build artifacts + uses: eProsima/eProsima-CI/external/upload-artifact@v0 + with: + name: fastdds_python_build_${{ inputs.label }} + path: ${{ github.workspace }} + + + fastdds_python_test: + needs: fastdds_python_build + runs-on: ${{ inputs.os-version }} + if: ${{ inputs.run-tests == true }} + strategy: + fail-fast: false + matrix: + cmake-build-type: + - 'RelWithDebInfo' + steps: + - name: Download python build artifacts + uses: eProsima/eProsima-CI/external/download-artifact@v0 + with: + name: fastdds_python_build_${{ inputs.label }} + path: ${{ github.workspace }} + + - name: Install Fix Python version + uses: eProsima/eProsima-CI/external/setup-python@v0 + with: + python-version: '3.11' + + - name: Get minimum supported version of CMake + uses: eProsima/eProsima-CI/external/get-cmake@v0 + with: + cmakeVersion: '3.22.6' + + - name: Install OpenSSL + uses: eProsima/eprosima-CI/windows/install_openssl@v0 + with: + version: '3.1.1' + + - name: Update OpenSSL environment variables + run: | + # 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 pywin32 pytest + + - name: Install swig + shell: pwsh + run: choco install swig --allow-downgrade --version=4.0.2.04082020 + + - name: Install doxygen + uses: eProsima/eProsima-CI/external/install_doxygen@v0 + + - name: Prepare build meta file + uses: eProsima/eProsima-CI/windows/merge_yaml_metas@v0 + with: + metas: "@('${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta', '${{ github.workspace }}/src/fastdds_python/.github/workflows/config/windows_test.meta')" + path: '${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build_test.meta' + + - name: Colcon build + continue-on-error: false + uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build_test.meta + colcon_build_args: ${{ inputs.colcon-args }} + colcon_build_args_default: '--event-handlers console_direct+ --packages-select fastdds_python' + cmake_args: ${{ inputs.cmake-args }} + cmake_args_default: '-T ${{ inputs.vs-toolset }} ${{ env.colcon-build-default-cmake-args }}' + cmake_build_type: ${{ matrix.cmake-build-type }} + workspace: ${{ github.workspace }} + workspace_dependencies: ${{ github.workspace }}/install + + - name: Colcon test + id: python_test + uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0 + with: + colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/windows_test.meta + colcon_test_args: ${{ inputs.colcon-args }} + colcon_test_args_default: --event-handlers=console_direct+ + ctest_args: ${{ inputs.ctest-args }} + packages_names: fastdds_python + workspace: ${{ github.workspace }} + workspace_dependencies: '' + test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }} + + - name: Test summary + uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0 + if: ${{ !cancelled() }} + with: + junit_reports_dir: "${{ steps.python_test.outputs.ctest_results_path }}" + print_summary: 'True' + show_failed: 'True' + show_disabled: 'False' + show_skipped: 'False' diff --git a/.github/workflows/test.meta b/.github/workflows/test.meta deleted file mode 100644 index 1271f248..00000000 --- a/.github/workflows/test.meta +++ /dev/null @@ -1,17 +0,0 @@ -{ - "names": - { - "fastrtps": - { - "cmake-args": [ - "-DSECURITY=ON" - ] - }, - "fastdds_python": - { - "cmake-args": [ - "-DBUILD_TESTING=ON" - ] - } - } -} diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml new file mode 100644 index 00000000..fff4cee9 --- /dev/null +++ b/.github/workflows/ubuntu-ci.yml @@ -0,0 +1,75 @@ +name: Fast DDS Python Ubuntu CI + +on: + workflow_dispatch: + inputs: + os-version: + description: 'OS version to run the workflow' + required: false + default: 'ubuntu-22.04' + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastdds-python-branch: + description: 'Branch or tag of Fast DDS Python repository' + required: true + type: string + fastdds-branch: + description: 'Branch or tag of Fast DDS repository' + type: string + required: true + run-tests: + description: 'Run test suite of Fast DDS python' + required: false + type: boolean + default: true + use-ccache: + description: 'Use CCache to speed up the build' + required: false + type: boolean + default: false + pull_request: + types: + - review_requested + paths-ignore: + - '**.md' + - '**.txt' + - '!**/CMakeLists.txt' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + ubuntu-ci: + strategy: + fail-fast: false + matrix: + fastdds-branch: + - '2.14.x' + - '2.13.x' + if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} + uses: ./.github/workflows/reusable-ubuntu-ci.yml + with: + # It would be desirable to have a matrix of ubuntu OS for this job, but due to the issue opened in this ticket: + # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. + os-version: ${{ inputs.os-version || 'ubuntu-22.04' }} + label: 'ubuntu-ci-1.4.x-${{ matrix.fastdds-branch }}' + colcon-args: ${{ inputs.colcon-args }} + cmake-args: ${{ inputs.cmake-args }} + ctest-args: ${{ inputs.ctest-args }} + fastdds-python-branch: ${{ inputs.fastdds-python-branch || github.ref }} + fastdds-branch: ${{ inputs.fastdds-branch || matrix.fastdds-branch }} + run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} + run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} + use-ccache: ${{ inputs.use-ccache || false }} diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml new file mode 100644 index 00000000..bf2cb3ad --- /dev/null +++ b/.github/workflows/windows-ci.yml @@ -0,0 +1,79 @@ +name: Fast DDS Python Windows CI + +on: + workflow_dispatch: + inputs: + os-version: + description: 'OS version to run the workflow' + required: false + default: 'windows-2019' + type: string + vs-toolset: + description: 'The VS toolset to use for the build' + required: false + default: 'v142' + type: string + colcon-args: + description: 'Extra arguments for colcon cli' + required: false + type: string + cmake-args: + description: 'Extra arguments for cmake cli' + required: false + type: string + ctest-args: + description: 'Extra arguments for ctest cli' + required: false + type: string + fastdds-python-branch: + description: 'Branch or tag of Fast DDS Python repository' + required: true + type: string + fastdds-branch: + description: 'Branch or tag of Fast DDS repository' + type: string + required: true + run-tests: + description: 'Run test suite of Fast DDS python' + required: false + type: boolean + default: true + + pull_request: + types: + - review_requested + paths-ignore: + - '**.md' + - '**.txt' + - '!**/CMakeLists.txt' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + windows-ci: + strategy: + fail-fast: false + matrix: + vs-toolset: + - 'v141' + - 'v142' + fastdds-branch: + - '2.14.x' + - '2.13.x' + if: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'conflicts') }} + uses: ./.github/workflows/reusable-windows-ci.yml + with: + # It would be desirable to have a matrix of windows OS for this job, but due to the issue opened in this ticket: + # https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job. + os-version: ${{ inputs.os-version || 'windows-2019' }} + vs-toolset: ${{ inputs.vs-toolset || matrix.vs-toolset }} + label: 'windows-${{ matrix.vs-toolset }}-ci-1.4.x-${{ matrix.fastdds-branch }}' + colcon-args: ${{ inputs.colcon-args }} + cmake-args: ${{ inputs.cmake-args }} + ctest-args: ${{ inputs.ctest-args }} + fastdds-python-branch: ${{ inputs.fastdds-python-branch || github.ref }} + fastdds-branch: ${{ inputs.fastdds-branch || matrix.fastdds-branch }} + run-build: ${{ !(github.event_name == 'pull_request') || !contains(github.event.pull_request.labels.*.name, 'skip-ci') }} + run-tests: ${{ (inputs.run-tests == true) || ((github.event_name == 'pull_request') && (!contains(github.event.pull_request.labels.*.name, 'no-test'))) }} diff --git a/README.md b/README.md index 4cf06f71..4746f5ca 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ [![Issues](https://img.shields.io/github/issues/eProsima/Fast-DDS-python.svg)](https://github.com/eProsima/Fast-DDS-python/issues) [![Forks](https://img.shields.io/github/forks/eProsima/Fast-DDS-python.svg)](https://github.com/eProsima/Fast-DDS-python/network/members) [![Stars](https://img.shields.io/github/stars/eProsima/Fast-DDS-python.svg)](https://github.com/eProsima/Fast-DDS-python/stargazers) +[![Fast DDS Python Ubuntu CI (nightly)](https://github.com/eProsima/Fast-DDS-Python/actions/workflows/nightly-ubuntu-ci.yml/badge.svg)](https://github.com/eProsima/Fast-DDS-Python/actions/workflows/nightly-ubuntu-ci.yml) +[![Fast DDS Python Windows CI (nightly)](https://github.com/eProsima/Fast-DDS-Python/actions/workflows/nightly-windows-ci.yml/badge.svg)](https://github.com/eProsima/Fast-DDS-Python/actions/workflows/nightly-windows-ci.yml) *eProsima Fast DDS Python* is a Python binding for the [*eProsima Fast DDS*](https://github.com/eProsima/Fast-DDS) C++ library. diff --git a/RELEASE_SUPPORT.md b/RELEASE_SUPPORT.md new file mode 100644 index 00000000..dce79481 --- /dev/null +++ b/RELEASE_SUPPORT.md @@ -0,0 +1,3 @@ +# Release support + +Please, refer to the [main branch](https://github.com/eProsima/Fast-DDS-Python/blob/master/RELEASE_SUPPORT.md) for the latest version of this document. diff --git a/fastdds_python.repos b/fastdds_python.repos index 3d2ec276..9930015f 100644 --- a/fastdds_python.repos +++ b/fastdds_python.repos @@ -2,7 +2,7 @@ repositories: foonathan_memory_vendor: type: git url: https://github.com/eProsima/foonathan_memory_vendor.git - version: master + version: v1.3.1 fastcdr: type: git url: https://github.com/eProsima/Fast-CDR.git