Skip to content

Commit

Permalink
Support for fastcdr v1 & bump version to v2.12.1 (#94)
Browse files Browse the repository at this point in the history
* Refs #19760. Coexist fastcdr v1 and v2

Signed-off-by: Ricardo González Moreno <[email protected]>

* Refs #19760. Coexist fastcdr v1 and v2 [new approach]

Signed-off-by: Ricardo González Moreno <[email protected]>

* Refs #19760. Add CI

Signed-off-by: Ricardo González Moreno <[email protected]>

* Refs #19862: Bump version to 2.12.1

Signed-off-by: EduPonz <[email protected]>

---------

Signed-off-by: Ricardo González Moreno <[email protected]>
Signed-off-by: EduPonz <[email protected]>
Co-authored-by: EduPonz <[email protected]>
  • Loading branch information
richiware and EduPonz authored Nov 17, 2023
1 parent 6e3265b commit c6f5893
Show file tree
Hide file tree
Showing 26 changed files with 1,932 additions and 236 deletions.
23 changes: 23 additions & 0 deletions .github/actions/fetch-shapesdemo-repos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'fetch-shapesdemo-repos'
description: 'Fetch Shapes Demo 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-shapesdemo-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 ..
12 changes: 12 additions & 0 deletions .github/workflows/build.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"names":
{
"fastrtps" :
{
"cmake-args": [
"-DNO_TLS=ON",
"-DSECURITY=OFF"
]
}
}
}
151 changes: 151 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: build

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:
- master
schedule:
- cron: '0 0 * * *'

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

steps:

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'
arch: 'win64_msvc2019_64'
cache: true

- 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
- uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0

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

- uses: ./src/shapesdemo/.github/actions/fetch-shapesdemo-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:
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

- name: Build workspace
shell: pwsh
run: |
$installpath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
$modulepath = "$installpath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
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/shapesdemo/.github/workflows/build.meta `
--mixin rel-with-deb-info ccache ${{ steps.ninja.outputs.cmake_generator }}
- 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:
matrix:
fastcdr_version: ${{ fromJson(github.event.inputs.fastcdr_versions || '["1.1.x", "master"]') }}

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

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '5.15.2'

- name: Install apt packages
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: libasio-dev libtinyxml2-dev

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

- uses: ./src/shapesdemo/.github/actions/fetch-shapesdemo-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:
cmakeVersion: 3.22.6

- name: Setup ccache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0

- name: Build workspace
run: |
cmake --version
colcon build \
--event-handlers=console_direct+ \
--metas ./src/shapesdemo/.github/workflows/build.meta \
--mixin rel-with-deb-info ccache
- name: Upload Logs
uses: actions/upload-artifact@v1
with:
name: colcon-logs-ubuntu
path: log/
if: always()
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,9 @@ option(EPROSIMA_BUILD "Activate internal building" OFF)
###############################################################################
# Load external eProsima projects.
###############################################################################
set(FASTDDS_MIN_VERSION "2.12.0")
set(FASTCDR_MIN_VERSION "2.0.0")
set(FASTDDS_MIN_VERSION "2.12.1")

find_package(fastcdr ${FASTCDR_MIN_VERSION} REQUIRED)
find_package(fastcdr REQUIRED)
find_package(fastrtps ${FASTDDS_MIN_VERSION} REQUIRED)

# If ROS environment is not set, disable ROS features. If there's no TypeSupport for the ROS 2 type, disable them as well.
Expand Down Expand Up @@ -200,13 +199,15 @@ set( SHAPESDEMO_SOURCES
src/shapesdemo/ShapesDemo.cpp
src/shapesdemo/ShapeSubscriber.cpp
types/Shape.cxx
types/Shapev1.cxx
types/ShapePubSubTypes.cxx
types/ShapeTypeObject.cxx
)

if(BUILD_ROS_COMPONENTS)
list( APPEND SHAPESDEMO_SOURCES
types/KeylessShapeType.cxx
types/KeylessShapeTypev1.cxx
types/KeylessShapeTypePubSubTypes.cxx
types/KeylessShapeTypeTypeObject.cxx
)
Expand Down
1 change: 1 addition & 0 deletions ShapesDemo.pro
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ SOURCES += \
src/qt/ContentFilterSelector.cpp \
src/shapesdemo/ShapeHistory.cpp \
src/shapesdemo/Shape.cxx \
src/shapesdemo/Shapev1.cxx \
src/shapesdemo/ShapePubSubTypes.cxx


Expand Down
6 changes: 3 additions & 3 deletions shapes-demo-ros2.repos
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ repositories:
fastcdr:
type: git
url: https://github.com/eProsima/Fast-CDR.git
version: v2.0.0
version: v2.1.0
fastdds:
type: git
url: https://github.com/eProsima/Fast-DDS.git
version: v2.12.0
version: v2.12.1
shapes-demo-typesupport:
type: git
url: https://github.com/eProsima/ShapesDemo-TypeSupport.git
version: v1.0.0
shapes-demo:
type: git
url: https://github.com/eProsima/ShapesDemo.git
version: v2.12.0
version: v2.12.1
6 changes: 3 additions & 3 deletions shapes-demo.repos
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ repositories:
fastcdr:
type: git
url: https://github.com/eProsima/Fast-CDR.git
version: v2.0.0
version: v2.1.0
fastdds:
type: git
url: https://github.com/eProsima/Fast-DDS.git
version: v2.12.0
version: v2.12.1
shapes-demo:
type: git
url: https://github.com/eProsima/ShapesDemo.git
version: v2.12.0
version: v2.12.1
Loading

0 comments on commit c6f5893

Please sign in to comment.