From 248fe41db09842fb67a7e6cf5793c472b82557af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Gonz=C3=A1lez=20Moreno?= Date: Fri, 20 Oct 2023 11:30:11 +0200 Subject: [PATCH] Refs #19657. Using eprosima-ci MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo González Moreno --- .github/workflows/build_and_test.yml | 111 ++++++++------------------- fastdds_python.repos | 1 - fastdds_python/CMakeLists.txt | 2 +- 3 files changed, 33 insertions(+), 81 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 52de0278..c9f3aa6b 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -19,54 +19,23 @@ jobs: steps: - - name: install OpenSSL - shell: pwsh - run: | - choco install openssl -yr --no-progress - "System32;SysWoW64" -split ";" | Join-Path -Path $env:windir -ChildPath {$_} ` - | ls -Include libssl-*.dll | rm - - - name: Install ninja - if: github.event.schedule == '' - shell: pwsh - run: choco install ninja - - - name: Setting ninja - id: ninja - if: github.event.schedule == '' - shell: pwsh - run: echo "cmake_generator=ninja" >> $Env:GITHUB_OUTPUT + - uses: eProsima/eProsima-CI/windows/install_openssl@v0 - name: Install swig shell: pwsh run: choco install swig --allow-downgrade --version=4.0.2.04082020 - - name: Install python build dependencies - shell: pwsh - run: | - pip install -U colcon-common-extensions colcon-mixin vcstool; - colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml; colcon mixin update default + - uses: eProsima/eProsima-CI/external/setup-python@feature/ccache + with: + python-version: '3.11' - - name: Install python tests dependencies - shell: pwsh - run: | - cd (ni -Type Directory -Path "$Env:TMP\$(New-Guid)") - $cr = "`n" - 'cmake_minimum_required(VERSION 3.5)' + $cr + - 'project(dummy VERSION 1.0.0 LANGUAGES CXX)' + $cr + - 'find_package (Python3 COMPONENTS Interpreter Development REQUIRED)' + $cr + - 'message(STATUS "cmake detected python=>>>>>${Python3_EXECUTABLE}<<<<<<")' | - Out-File CMakeLists.txt - (cmake .) *>&1 | % { - if($_ -Match "cmake detected python=>>>>>(?.*)<<<<<<") - { - $python_exec = $Matches.exec - return - } - } - & $python_exec -m pip install -U pytest pywin32 - - - uses: actions/checkout@v4 + - uses: eProsima/eProsima-CI/multiplatform/install_python_packages@feature/ccache + with: + packages: pytest pywin32 vcstool + + - uses: eProsima/eProsima-CI/multiplatform/install_colcon@feature/ccache + + - uses: eProsima/eProsima-CI/external/checkout@v0 with: path: src/fastdds_python @@ -75,28 +44,20 @@ jobs: run: | vcs import src --skip-existing --input src/fastdds_python/fastdds_python.repos - - name: Get minimum supported version of CMake - uses: lukka/get-cmake@latest + - uses: eProsima/eProsima-CI/external/get-cmake@feature/ccache with: cmakeVersion: 3.22.6 - - name: Use cmake - run: cmake --version - - - name: Install ccache + - name: Setting ninja + id: ninja + if: github.event.schedule == '' shell: pwsh run: | - pwsh -File "src\fastdds_python\.github\ci\ccache.ps1" - $ccache_dir = $pwd.PATH - $ccache_dir = "$ccache_dir\.github\ccache" - echo "$ccache_dir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - Set-Item -Force -Path "env:PATH" -Value "$ccache_dir;$env:PATH" - ccache --version + echo "cmake_generator=ninja" >> $Env:GITHUB_OUTPUT - name: Setup ccache - uses: Chocobo1/setup-ccache-action@v1 + uses: eProsima/eProsima-CI/external/setup-ccache-action@feature/ccache with: - prepend_symlinks_to_path: false install_ccache: false windows_compile_environment: msvc @@ -108,6 +69,7 @@ jobs: Import-Module $modulepath Enter-VsDevShell -SetDefaultWindowTitle -InstallPath $installpath ` -StartInPath (pwd) -DevCmdArguments '/arch=x64 /host_arch=x64'; + cmake --version colcon build --executor parallel --event-handlers console_direct+ desktop_notification- ` --metas ./src/fastdds_python/.github/workflows/test.meta ` --mixin rel-with-deb-info ccache ${{ steps.ninja.outputs.cmake_generator }} @@ -129,43 +91,34 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 + - uses: eProsima/eProsima-CI/external/checkout@v0 with: path: src/fastdds_python - - name: Install apt dependencies - run: | - sudo apt update - sudo apt install -y \ - python3 \ - python3-pip \ - swig \ - libpython3-dev - - - name: Install python dependencies - run: | - sudo pip3 install -U \ - colcon-common-extensions \ - colcon-mixin \ - vcstool - colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml; colcon mixin update default + - uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0 + with: + packages: libpython3-dev swig + + - uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0 + with: + packages: vcstool + + - uses: eProsima/eProsima-CI/multiplatform/install_colcon@feature/ccache - name: Fetch repositories run: | vcs import --skip-existing src < src/fastdds_python/fastdds_python.repos - - name: Get minimum supported version of CMake - uses: lukka/get-cmake@latest + - uses: eProsima/eProsima-CI/external/get-cmake@feature/ccache with: cmakeVersion: 3.22.6 - - name: Use cmake - run: cmake --version - name: Setup ccache - uses: Chocobo1/setup-ccache-action@v1 + uses: eProsima/eProsima-CI/external/setup-ccache-action@feature/ccache - name: Build workspace - run: > + run: | + cmake --version colcon build \ --event-handlers=console_direct+ \ --metas ./src/fastdds_python/.github/workflows/test.meta \ diff --git a/fastdds_python.repos b/fastdds_python.repos index 0e1d3ad9..3c54fb58 100644 --- a/fastdds_python.repos +++ b/fastdds_python.repos @@ -23,4 +23,3 @@ repositories: type: git url: https://github.com/eProsima/IDL-Parser.git version: master - diff --git a/fastdds_python/CMakeLists.txt b/fastdds_python/CMakeLists.txt index cee2b730..01a8d011 100644 --- a/fastdds_python/CMakeLists.txt +++ b/fastdds_python/CMakeLists.txt @@ -40,7 +40,7 @@ find_package(SWIG REQUIRED) include(${SWIG_USE_FILE}) set(CMAKE_SWIG_FLAGS "") -find_package (Python3 COMPONENTS Interpreter Development REQUIRED) +find_package(Python3 COMPONENTS Interpreter Development REQUIRED) find_package(fastcdr 2 REQUIRED) find_package(fastrtps 2.12 REQUIRED)