5454 node-version : ${{ matrix.node-version }}
5555 architecture : ${{ matrix.architecture }}
5656
57+ # Checkout early so the local composite action under .github/actions is
58+ # available to the rolling / lyrical apt setup step below.
59+ - uses : actions/checkout@v6
60+
5761 - name : Setup ROS2
5862 if : ${{ matrix.ros_distribution != 'rolling' && matrix.ros_distribution != 'lyrical' }}
5963 uses : ros-tooling/setup-ros@v0.7
@@ -62,30 +66,11 @@ jobs:
6266
6367 - name : Enable ROS2 apt repository (rolling / lyrical)
6468 if : ${{ matrix.ros_distribution == 'rolling' || matrix.ros_distribution == 'lyrical' }}
65- run : |
66- apt-get update
67- apt-get install -y sudo software-properties-common curl
68-
69- # Enable required repositories. The same setup applies to both the
70- # rolling nightly tarball and the lyrical apt-deb install; see the
71- # per-distro install docs for reference:
72- # rolling: https://docs.ros.org/en/rolling/Installation/Alternatives/Ubuntu-Install-Binary.html
73- # lyrical: https://docs.ros.org/en/lyrical/Installation/Ubuntu-Install-Debs.html
74- add-apt-repository universe
75- ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F'"' '{print $4}')
76- curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo ${UBUNTU_CODENAME:-${VERSION_CODENAME}})_all.deb"
77- dpkg -i /tmp/ros2-apt-source.deb
78- apt-get update
79- # Common build deps for both rolling and lyrical. Rolling-only tarball
80- # tooling (tar, bzip2, python3-rosdep) is installed in the rolling step
81- # below so the lyrical lane stays minimal.
82- apt-get install -y build-essential cmake python3 python3-colcon-common-extensions
83-
84- - name : Install ROS2 from apt (lyrical)
85- if : ${{ matrix.ros_distribution == 'lyrical' }}
86- run : |
87- # Per https://docs.ros.org/en/lyrical/Installation/Ubuntu-Install-Debs.html
88- apt-get install -y ros-lyrical-desktop
69+ uses : ./.github/actions/setup-ros2-apt
70+ with :
71+ # Lyrical installs the desktop from apt here; rolling only needs the
72+ # repository enabled and installs ROS2 from a tarball in the next step.
73+ install-desktop : ${{ matrix.ros_distribution == 'lyrical' }}
8974
9075 - name : Install ROS2 from binary tarball (rolling)
9176 if : ${{ matrix.ros_distribution == 'rolling' }}
@@ -121,8 +106,6 @@ jobs:
121106 fi
122107 sudo apt install -y xvfb libgtk-3-0 libnss3 $LIBASOUND_PKG libgbm-dev
123108
124- - uses : actions/checkout@v6
125-
126109 # The mocha suite and the Electron postinstall (extract-zip 2.0.1) are
127110 # known to be intermittently flaky on this runner. Wrap both test
128111 # invocations in nick-fields/retry@v4 so a single transient failure does
0 commit comments