Skip to content

Update FLANN configuration for better compatibility #9

Update FLANN configuration for better compatibility

Update FLANN configuration for better compatibility #9

Workflow file for this run

name: ROS2 Build

Check failure on line 1 in .github/workflows/ci-ros2.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci-ros2.yml

Invalid workflow file

(Line: 175, Col: 9): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.ros_distro == 'humble'
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
ros2-build:
name: ROS2 ${{ matrix.ros_distro }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
ros_distro: humble
- os: ubuntu-24.04
ros_distro: jazzy
container:
image: osrf/ros:${{ matrix.ros_distro }}-desktop
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup ROS2 workspace
run: |
# Update package lists
apt-get update
# Install additional dependencies
apt-get install -y \
python3-pip \
python3-colcon-common-extensions \
python3-colcon-mixin \
python3-rosdep \
python3-vcstool \
build-essential \
cmake \
ninja-build \
ccache \
git \
wget \
curl
- name: Install system dependencies
run: |
apt-get install -y \
libeigen3-dev \
libtbb-dev \
liblz4-dev \
libflann-dev \
libpcl-dev \
libgtsam-dev \
ros-${{ matrix.ros_distro }}-pcl-ros \
ros-${{ matrix.ros_distro }}-pcl-conversions \
ros-${{ matrix.ros_distro }}-tf2-eigen \
ros-${{ matrix.ros_distro }}-tf2-geometry-msgs \
ros-${{ matrix.ros_distro }}-tf2-sensor-msgs
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
key: ros2-ccache-${{ matrix.ros_distro }}-${{ matrix.os }}
restore-keys: ros2-ccache-${{ matrix.ros_distro }}
- name: Initialize rosdep
run: |
rosdep init || true
rosdep update
- name: Create ROS2 workspace
run: |
mkdir -p /ros2_ws/src
# Copy KISS-Matcher to workspace
cp -r /github/workspace/cpp/kiss_matcher /ros2_ws/src/
cp -r /github/workspace/ros /ros2_ws/src/kiss_matcher_ros
- name: Install ROS dependencies
working-directory: /ros2_ws
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
rosdep install --from-paths src --ignore-src -y
- name: Build KISS-Matcher Core
working-directory: /ros2_ws
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
# Build core library first
colcon build \
--packages-select kiss_matcher \
--cmake-args \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DUSE_CCACHE=ON \
-DUSE_SYSTEM_EIGEN3=ON \
-DUSE_SYSTEM_TBB=ON \
-DUSE_SYSTEM_ROBIN=OFF \
-DUSE_SYSTEM_FLANN=OFF \
--parallel-workers $(nproc)
- name: Build ROS2 wrapper
working-directory: /ros2_ws
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
source install/setup.bash
# Build ROS2 wrapper
colcon build \
--packages-select kiss_matcher_ros \
--cmake-args \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
--parallel-workers $(nproc)
- name: Run colcon tests
working-directory: /ros2_ws
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
source install/setup.bash
# Test the build
colcon test \
--packages-select kiss_matcher kiss_matcher_ros \
--parallel-workers $(nproc) \
--return-code-on-test-failure || true
- name: Show test results
working-directory: /ros2_ws
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
colcon test-result --all --verbose || true
- name: Verify ROS2 nodes can be listed
working-directory: /ros2_ws
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
source install/setup.bash
# Check if nodes are available (basic smoke test)
timeout 10s ros2 pkg list | grep kiss_matcher || echo "Package listing completed"
# Check if launch files are available
find install/ -name "*.launch*" | head -5 || echo "No launch files found"
- name: Upload ROS2 build artifacts
uses: actions/upload-artifact@v4
with:
name: ros2-build-${{ matrix.ros_distro }}-${{ matrix.os }}
path: |
/ros2_ws/build/
/ros2_ws/install/
!/ros2_ws/build/**/CMakeFiles/
!/ros2_ws/build/**/*.o
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: ros2-test-results-${{ matrix.ros_distro }}-${{ matrix.os }}
path: /ros2_ws/log/
ros2-integration-test:
name: ROS2 Integration Test (${{ matrix.ros_distro }})
runs-on: ubuntu-22.04
needs: ros2-build
if: matrix.ros_distro == 'humble' # Only run integration tests on one distro
strategy:
matrix:
ros_distro: [humble]
container:
image: osrf/ros:${{ matrix.ros_distro }}-desktop
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: ros2-build-${{ matrix.ros_distro }}-ubuntu-22.04
path: /ros2_ws/
- name: Setup ROS2 environment
run: |
apt-get update
apt-get install -y python3-colcon-common-extensions
- name: Basic integration test
working-directory: /ros2_ws
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
source install/setup.bash
# Test basic functionality - launch a node briefly
echo "Testing ROS2 integration..."
# Check if we can source the workspace
echo "Workspace sourced successfully"
# List available packages
ros2 pkg list | grep kiss_matcher || echo "Package check completed"
echo "ROS2 integration test completed"