Skip to content

Commit a8a512e

Browse files
committed
Address comments
1 parent 6995143 commit a8a512e

3 files changed

Lines changed: 61 additions & 45 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: 'Setup ROS2 apt repository'
2+
description: >-
3+
Enable the official ros-apt-source repository (and common build deps) on
4+
Ubuntu, and optionally install the Lyrical Luth desktop. Shared by the
5+
build-and-test and ASan workflows so the lyrical/rolling apt setup lives in
6+
one place.
7+
8+
inputs:
9+
install-desktop:
10+
description: >-
11+
When 'true' (default) install ros-lyrical-desktop. Set to 'false' to only
12+
enable the apt repository and build deps (e.g. the rolling lane installs
13+
ROS2 from a binary tarball after this action runs).
14+
required: false
15+
default: 'true'
16+
17+
runs:
18+
using: 'composite'
19+
steps:
20+
- name: Enable ROS2 apt repository
21+
shell: bash
22+
run: |
23+
apt-get update
24+
apt-get install -y sudo software-properties-common curl
25+
26+
# Enable required repositories. The same setup applies to both the
27+
# rolling nightly tarball and the lyrical apt-deb install; see the
28+
# per-distro install docs for reference:
29+
# rolling: https://docs.ros.org/en/rolling/Installation/Alternatives/Ubuntu-Install-Binary.html
30+
# lyrical: https://docs.ros.org/en/lyrical/Installation/Ubuntu-Install-Debs.html
31+
add-apt-repository universe
32+
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}')
33+
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"
34+
dpkg -i /tmp/ros2-apt-source.deb
35+
apt-get update
36+
# Common build deps for both rolling and lyrical. Rolling-only tarball
37+
# tooling (tar, bzip2, python3-rosdep) is installed by the caller so the
38+
# lyrical lane stays minimal.
39+
apt-get install -y build-essential cmake python3 python3-colcon-common-extensions
40+
41+
- name: Install ROS2 from apt (lyrical)
42+
if: ${{ inputs.install-desktop == 'true' }}
43+
shell: bash
44+
run: |
45+
# Per https://docs.ros.org/en/lyrical/Installation/Ubuntu-Install-Debs.html
46+
apt-get install -y ros-lyrical-desktop

.github/workflows/linux-x64-asan-test.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,18 @@ jobs:
2626
node-version: 24.X
2727
architecture: x64
2828

29-
- name: Enable ROS2 apt repository (lyrical)
30-
run: |
31-
# ros-tooling/setup-ros does not support lyrical yet, so install from
32-
# the official apt repo as documented at
33-
# https://docs.ros.org/en/lyrical/Installation/Ubuntu-Install-Debs.html
34-
apt-get update
35-
apt-get install -y sudo software-properties-common curl
36-
37-
add-apt-repository universe
38-
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}')
39-
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"
40-
dpkg -i /tmp/ros2-apt-source.deb
41-
apt-get update
42-
apt-get install -y build-essential cmake python3 python3-colcon-common-extensions
29+
- uses: actions/checkout@v6
4330

44-
- name: Install ROS2 from apt (lyrical)
45-
run: |
46-
apt-get install -y ros-lyrical-desktop
31+
- name: Setup ROS2 Lyrical from apt
32+
# ros-tooling/setup-ros does not support lyrical yet, so the shared
33+
# composite action installs it from the official apt repo. See
34+
# https://docs.ros.org/en/lyrical/Installation/Ubuntu-Install-Debs.html
35+
uses: ./.github/actions/setup-ros2-apt
4736

4837
- name: Install test dependencies
4938
run: |
5039
sudo apt install -y ros-lyrical-test-msgs ros-lyrical-mrpt-msgs
5140
52-
- uses: actions/checkout@v6
53-
5441
- name: Install npm dependencies
5542
run: |
5643
source /opt/ros/lyrical/setup.bash

.github/workflows/linux-x64-build-and-test.yml

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ jobs:
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

Comments
 (0)