Skip to content

Exercise both odometry formulations in the long-drift test #420

Exercise both odometry formulations in the long-drift test

Exercise both odometry formulations in the long-drift test #420

Workflow file for this run

# Based on GTSAM file (by @ProfFan)
name: CI Build colcon
on: [ push ]
jobs:
build_docker:
# On Linux, iterates on all ROS 2 distributions.
runs-on: ubuntu-latest
env:
DEBIAN_FRONTEND: noninteractive
continue-on-error: ${{ matrix.allow_failure == true }}
strategy:
matrix:
include:
# Humble Hawksbill (May 2022 - May 2027)
#- docker_image: ubuntu:jammy
# ros_distribution: humble
# use_ros_testing: false
- docker_image: ubuntu:jammy
ros_distribution: humble
use_ros_testing: true
# Jazzy Jalisco (May 2024 - May 2029)
#- docker_image: ubuntu:noble
# ros_distribution: jazzy
# use_ros_testing: false
- docker_image: ubuntu:noble
ros_distribution: jazzy
use_ros_testing: true
coverage_run: true
# Rolling Ridley (No End-Of-Life)
# TODO: migrate to ubuntu:resolute once rolling packages are published there.
# Track: https://discourse.openrobotics.org/t/preparing-for-rolling-sync-2026-04-23/54223
#- docker_image: ubuntu:noble
# ros_distribution: rolling
# use_ros_testing: false
#- docker_image: ubuntu:noble
# ros_distribution: rolling
# use_ros_testing: true
#- docker_image: ubuntu:noble
# ros_distribution: rolling
# use_ros_testing: true
# coverage_run: true
# Lyrical Luth (May 2026 - May 2031, LTS)
# Beta packages available on resolute; GA release expected May 22, 2026.
# allow_failure until GA is released.
#- docker_image: ubuntu:resolute
# ros_distribution: lyrical
# use_ros_testing: true
# allow_failure: true
container:
image: ${{ matrix.docker_image }}
steps:
- name: Checkout
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
apt-get -y update
apt-get -y install git curl gnupg2 ca-certificates
git clone https://$TOKEN@github.com/$GITHUB_REPOSITORY.git --recursive "$GITHUB_WORKSPACE"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git checkout $GITHUB_SHA
git submodule update --init --recursive
# apt-key was removed in Ubuntu 26.04 (Resolute Raccoon). For resolute-based
# builds we set up the ROS repo manually before setup-ros runs, which would
# otherwise call apt-key internally and fail.
- name: Setup ROS apt repository (Ubuntu 26.04+)
if: matrix.docker_image == 'ubuntu:resolute'
run: |
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
-o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" \
| tee /etc/apt/sources.list.d/ros2.list > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
http://packages.ros.org/ros2-testing/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" \
| tee /etc/apt/sources.list.d/ros2-testing.list > /dev/null
apt-get update
# setup-ros resolves the ROS apt source package version via an
# unauthenticated call to api.github.com, which occasionally hits
# GitHub's rate limit and fails the whole job. Pre-configuring the apt
# repository here makes setup-ros detect it is already present and
# skip that lookup.
- name: Pre-configure ROS apt repository
if: matrix.docker_image != 'ubuntu:resolute'
run: |
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
-o /usr/share/keyrings/ros-archive-keyring.gpg
ros_channel="ros2"
if [ "${{ matrix.use_ros_testing }}" = "true" ]; then
ros_channel="ros2-testing"
fi
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] \
http://packages.ros.org/${ros_channel}/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" \
| tee /etc/apt/sources.list.d/ros2.list > /dev/null
apt-get update
- name: setup ROS environment
if: matrix.docker_image != 'ubuntu:resolute'
uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: ${{ matrix.ros_distribution }}
use-ros2-testing: ${{ matrix.use_ros_testing }}
# On resolute, setup-ros can't be used (calls apt-key which is gone).
# Install the equivalent packages manually instead.
- name: Setup ROS environment (Ubuntu 26.04+)
if: matrix.docker_image == 'ubuntu:resolute'
run: |
apt-get install -y \
ros-${{ matrix.ros_distribution }}-ros-base \
python3-rosdep \
python3-colcon-common-extensions \
python3-colcon-mixin \
ros-dev-tools
rosdep init || true
rosdep update
- name: Install rosdep dependencies
run: |
. /opt/ros/*/setup.sh
rosdep update
rosdep install --from-paths . --ignore-src -y
- name: Install lcov for coverage analysis
if: matrix.coverage_run == true
run: |
apt-get update
apt-get install -y lcov
- name: Build with colcon
run: |
. /opt/ros/*/setup.sh
env
# Inject Coverage Build Type
if [ "${{ matrix.coverage_run }}" = "true" ]; then
echo "Enabling Coverage build type..."
EXTRA_CMAKE_ARGS="$EXTRA_CMAKE_ARGS -DCMAKE_BUILD_TYPE=Coverage"
fi
env
MAKEFLAGS="-j2" colcon build \
--symlink-install \
--parallel-workers 2 \
--event-handlers console_direct+ \
--cmake-args $EXTRA_CMAKE_ARGS
- name: Run unit tests
run: |
. /opt/ros/*/setup.sh
colcon test --event-handlers console_direct+
colcon test-result --verbose
- name: Generate coverage report
if: matrix.coverage_run == true
run: |
lcov --capture --directory . --output-file coverage.info \
--ignore-errors mismatch --rc geninfo_unexecuted_blocks=1
lcov --remove coverage.info '/opt/ros/*' '/usr/*' \
--ignore-errors unused --output-file coverage_filtered.info
echo "--- Coverage Summary for mola-state-estimation ---"
lcov --list coverage_filtered.info
echo "------------------------------------------"
- name: Upload coverage to Codecov
if: matrix.coverage_run == true
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage_filtered.info
slug: MOLAorg/mola_state_estimation
flags: colcon,rolling,gcc