Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[19909] Support Fast CDR v1 and v2 & bump version to 1.3.1 #70

Merged
merged 10 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/fetch-fastdds_python-repos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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 ..
16 changes: 0 additions & 16 deletions .github/ci/ccache.ps1

This file was deleted.

2 changes: 2 additions & 0 deletions .github/dco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require:
members: false
56 changes: 42 additions & 14 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ 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: 'master'
pull_request:
push:
branches:
Expand All @@ -12,6 +25,9 @@ on:
jobs:
windows-build-test:
runs-on: windows-2019
strategy:
matrix:
fastcdr_version: ${{ fromJson(github.event.inputs.fastcdr_versions || '["1.1.x", "master"]') }}

env:
CXXFLAGS: /MP
Expand All @@ -21,6 +37,17 @@ jobs:

- uses: eProsima/eProsima-CI/windows/install_openssl@v0

- 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
Expand All @@ -31,18 +58,19 @@ jobs:

- uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
with:
packages: pytest pywin32 vcstool
packages: pytest pywin32

- uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0

- uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src/fastdds_python

- name: Fetch repositories
shell: pwsh
run: |
vcs import src --skip-existing --input src/fastdds_python/fastdds_python.repos
- uses: ./src/fastdds_python/.github/actions/fetch-fastdds_python-repos
with:
foonathan-memory-vendor-branch: ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }}
fastcdr-branch: ${{ matrix.fastcdr_version }}
fastdds-branch: ${{ github.event.inputs.fastdds_branch || 'master' }}

- uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
Expand All @@ -58,7 +86,6 @@ jobs:
- name: Setup ccache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0
with:
install_ccache: false
windows_compile_environment: msvc

- name: Build workspace
Expand Down Expand Up @@ -89,6 +116,9 @@ jobs:

ubuntu-build-test:
runs-on: ubuntu-22.04
strategy:
matrix:
fastcdr_version: ${{ fromJson(github.event.inputs.fastcdr_versions || '["1.1.x", "master"]') }}

steps:
- uses: eProsima/eProsima-CI/external/checkout@v0
Expand All @@ -97,17 +127,15 @@ jobs:

- 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
packages: libasio-dev libtinyxml2-dev libpython3-dev swig

- uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0

- name: Fetch repositories
run: |
vcs import --skip-existing src < src/fastdds_python/fastdds_python.repos
- uses: ./src/fastdds_python/.github/actions/fetch-fastdds_python-repos
with:
foonathan-memory-vendor-branch: ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }}
fastcdr-branch: ${{ matrix.fastcdr_version }}
fastdds-branch: ${{ github.event.inputs.fastdds_branch || 'master' }}

- uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.meta
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"fastrtps":
{
"cmake-args": [
"-DTHIRDPARTY=ON",
"-DSECURITY=ON",
"-DSECURITY=ON"
]
},
"fastdds_python":
Expand Down
4 changes: 2 additions & 2 deletions fastdds_python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if(POLICY CMP0086)
cmake_policy(SET CMP0086 NEW)
endif()

project(fastdds_python VERSION 1.3.0)
project(fastdds_python VERSION 1.3.1)

# Set BUILD_TESTING to OFF by default.
if(NOT BUILD_TESTING)
Expand All @@ -42,7 +42,7 @@ set(CMAKE_SWIG_FLAGS "")

find_package(Python3 COMPONENTS Interpreter Development REQUIRED)

find_package(fastcdr 2 REQUIRED)
find_package(fastcdr REQUIRED)
find_package(fastrtps 2.12 REQUIRED)

###############################################################################
Expand Down
3 changes: 3 additions & 0 deletions fastdds_python/src/swig/fastdds.i
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ namespace builtin {
// Failing to do so will issue a warning, but will not stop the compilation.
// However, the resulting derived class will **not** be considered as inheriting from the base class

%include <fastcdr/config.h>
#if FASTCDR_VERSION_MAJOR > 1
%include "fastcdr/xcdr/optional.i"
#endif

%include "fastdds/rtps/common/VendorId_t.i"
%include "fastdds/rtps/common/Types.i"
Expand Down
16 changes: 15 additions & 1 deletion fastdds_python/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,18 @@
# Compile types
add_subdirectory(types)

add_test(NAME api_tests COMMAND ${Python3_EXECUTABLE} -m pytest -vrP WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/api)
set(fastcdr_version_argument "v2")
if (${fastcdr_VERSION_MAJOR} EQUAL 1)
set(fastcdr_version_argument "v1")
endif()


add_test(NAME api_tests
COMMAND
${Python3_EXECUTABLE}
-m pytest
-vrP
--cdr ${fastcdr_version_argument}
WORKING_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/api
)
3 changes: 3 additions & 0 deletions fastdds_python/test/api/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

def pytest_addoption(parser):
parser.addoption("--cdr", action="store", default="v2")
Loading