Skip to content

Remove now-unused config_file::is_empty() #47

Remove now-unused config_file::is_empty()

Remove now-unused config_file::is_empty() #47

name: build_lrs_ROS2_package
on:
push:
branches: ['**']
pull_request:
branches: ['**']
permissions: read-all
jobs:
build_lrs_ros2_package:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
# Lyrical can hit transient upstream availability issues during the
# platform transition; don't cancel siblings if one row fails.
fail-fast: false
matrix:
ros_distribution:
- humble
- kilted
- jazzy
- lyrical
include:
# Humble Hawksbill
- docker_image: ubuntu:jammy
ros_distribution: humble
# Kilted Kaiju
- docker_image: ubuntu:noble
ros_distribution: kilted
# Jazzy Jalisco
- docker_image: ubuntu:noble
ros_distribution: jazzy
# Lyrical Luth
- docker_image: ubuntu:resolute
ros_distribution: lyrical
container:
image: ${{ matrix.docker_image }}
steps:
- name: install ROS 2 apt source
# Workaround: setup-ros resolves the ros-apt-source version via an
# unauthenticated GitHub API call (60 req/hour per IP, shared across
# hosted runners), which intermittently gets rate-limited and fails the
# job with a 404. Pre-installing the package here makes setup-ros skip
# that step.
# Remove once fixed upstream (ros-tooling/setup-ros).
shell: bash
env:
# Pin ros-apt-source to a known release; the .deb is verified against
# a per-codename SHA-256 below so a tampered CDN can't be silently
# installed. When bumping ROS_APT_SOURCE_VERSION, also update the
# hashes from the new release assets:
# https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/tags/<VERSION>
# (each asset has a `digest: sha256:...` field).
ROS_APT_SOURCE_VERSION: "1.2.0"
run: |
set -euo pipefail
apt-get update && apt-get install -y --no-install-recommends curl ca-certificates
codename=$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
pkg=ros2-apt-source
# Pinned SHA-256 per codename for ROS_APT_SOURCE_VERSION above.
case "${codename}" in
jammy) expected=767884cf4ed03116b9d64438930a832ed854147ae435279a7924dfdf60f94433 ;;
noble) expected=0804d9b13db770eb87019be414cd78378835228ad5fa801fc88758596dd8f7e5 ;;
resolute) expected=a275b9b819874e745a928e83e39c429fa4d607159285c4ef3ebcf75afa732ee3 ;;
*) echo "ERROR: no pinned SHA-256 for ${pkg}_${codename} at v${ROS_APT_SOURCE_VERSION}"; exit 1 ;;
esac
deb="${pkg}_${ROS_APT_SOURCE_VERSION}.${codename}_all.deb"
curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors -o /tmp/ros2-apt-source.deb \
"https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/${deb}"
actual=$(sha256sum /tmp/ros2-apt-source.deb | awk '{print $1}')
if [ "${actual}" != "${expected}" ]; then
echo "ERROR: SHA-256 mismatch for ${deb}"
echo " expected: ${expected}"
echo " actual: ${actual}"
exit 1
fi
dpkg -i /tmp/ros2-apt-source.deb
- name: setup ROS environment
uses: ros-tooling/setup-ros@77bcad67a6cb15f6192d61464d99bbab658e4ca9 #v0.7.18
with:
required-ros-distributions: ${{ matrix.ros_distribution }}
- name: build librealsense ROS 2
uses: ros-tooling/action-ros-ci@3a640b10f09b756dabe556dac5413aba369f71b0 #v0.4.8
with:
target-ros2-distro: ${{ matrix.ros_distribution }}
skip-tests: true
colcon-defaults: | # We align the build flags to the librealsense2 ROS2 release build.
{
"build": {
"cmake-args": [
"-DBUILD_GRAPHICAL_EXAMPLES=OFF",
"-DBUILD_EXAMPLES=OFF"
]
}
}