-
Notifications
You must be signed in to change notification settings - Fork 84
155 lines (141 loc) · 6.18 KB
/
Copy pathlinux-x64-build-and-test.yml
File metadata and controls
155 lines (141 loc) · 6.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Build and Test (Reusable)
on:
workflow_call:
inputs:
trigger_type:
description: 'Type of trigger (pr or push)'
required: true
type: string
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
container:
image: ${{ matrix.docker_image }}
strategy:
fail-fast: false
matrix:
node-version: [24.X, 26.X]
architecture: [x64]
ros_distribution:
- humble
- jazzy
- kilted
- lyrical
- rolling
include:
# Humble Hawksbill (May 2022 - May 2027)
- docker_image: ubuntu:jammy
ros_distribution: humble
# Jazzy Jalisco (May 2024 - May 2029)
- docker_image: ubuntu:noble
ros_distribution: jazzy
# Kilted Kaiju (May 2025 - Dec 2026)
- docker_image: ubuntu:noble
ros_distribution: kilted
# Lyrical Luth (May 2026 - May 2031)
- docker_image: ubuntu:26.04
ros_distribution: lyrical
# Rolling Ridley (No End-Of-Life) - migrated to Ubuntu 26.04 (resolute)
# to follow the Lyrical Luth target platform.
# See: https://docs.ros.org/en/jazzy/Releases/Release-Lyrical-Luth.html
- docker_image: ubuntu:resolute
ros_distribution: rolling
ros_tar_url: "https://github.com/ros2/ros2/releases/download/release-rolling-nightlies/ros2-rolling-nightly-linux-amd64.tar.bz2"
steps:
- name: Setup Node.js ${{ matrix.node-version }} on ${{ matrix.architecture }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
architecture: ${{ matrix.architecture }}
# Checkout early so the local composite action under .github/actions is
# available to the rolling / lyrical apt setup step below.
- uses: actions/checkout@v6
- name: Setup ROS2
if: ${{ matrix.ros_distribution != 'rolling' && matrix.ros_distribution != 'lyrical' }}
uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: ${{ matrix.ros_distribution }}
- name: Enable ROS2 apt repository (rolling / lyrical)
if: ${{ matrix.ros_distribution == 'rolling' || matrix.ros_distribution == 'lyrical' }}
uses: ./.github/actions/setup-ros2-apt
with:
# Lyrical installs the desktop from apt here; rolling only needs the
# repository enabled and installs ROS2 from a tarball in the next step.
install-desktop: ${{ matrix.ros_distribution == 'lyrical' }}
- name: Install ROS2 from binary tarball (rolling)
if: ${{ matrix.ros_distribution == 'rolling' }}
run: |
# Tools only the rolling tarball path needs: tar/bzip2 for extraction,
# python3-rosdep for resolving runtime deps below.
apt-get install -y tar bzip2 python3-rosdep
# Extract binary tarball AFTER apt packages so its newer libs overwrite apt's older ones
curl -sL "${{ matrix.ros_tar_url }}" -o /tmp/ros2-${{ matrix.ros_distribution }}.tar.bz2
mkdir -p /opt/ros/${{ matrix.ros_distribution }}
tar xf /tmp/ros2-${{ matrix.ros_distribution }}.tar.bz2 --strip-components=1 -C /opt/ros/${{ matrix.ros_distribution }}
rm /tmp/ros2-${{ matrix.ros_distribution }}.tar.bz2
# Install any remaining runtime dependencies using rosdep
rosdep init || true
rosdep update
rosdep install --rosdistro ${{ matrix.ros_distribution }} --from-paths /opt/ros/${{ matrix.ros_distribution }}/share --ignore-src -y --skip-keys "cyclonedds fastcdr fastdds iceoryx_binding_c rmw_connextdds rti-connext-dds-7.3.0 rti-connext-dds-7.7.0 urdfdom_headers python3-pyqt6.qtsvg rosidl_buffer_py pybind11"
- name: Install test-msgs and mrpt_msgs on Linux
if: ${{ matrix.ros_distribution != 'rolling' }}
run: |
sudo apt install -y ros-${{ matrix.ros_distribution }}-test-msgs ros-${{ matrix.ros_distribution }}-mrpt-msgs
- name: Install Electron test dependencies
run: |
# Adjust dependencies based on Ubuntu version.
# 22.04 (jammy) uses libasound2; 24.04 (noble) and 26.04 (resolute) use the
# t64 ABI transition package libasound2t64.
LIBASOUND_PKG="libasound2"
if grep -Eq "VERSION_ID=\"(24\\.04|26\\.04)\"" /etc/os-release; then
LIBASOUND_PKG="libasound2t64"
fi
sudo apt install -y xvfb libgtk-3-0 libnss3 $LIBASOUND_PKG libgbm-dev
# The mocha suite and the Electron postinstall (extract-zip 2.0.1) are
# known to be intermittently flaky on this runner. Wrap both test
# invocations in nick-fields/retry@v4 so a single transient failure does
# not fail the whole matrix leg. Keep max_attempts conservative so real
# regressions still surface quickly.
- name: Build and test rclnodejs
uses: nick-fields/retry@v4
with:
shell: bash
max_attempts: 2
retry_wait_seconds: 10
timeout_minutes: 60
command: |
uname -a
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
npm i
npm run lint
# c8 (coverage) depends on yargs 17, whose extensionless `yargs/yargs`
# entry fails to load under `require()` on Node 26. Coverage is only
# uploaded from the Node 24.X leg, so wrap with c8 there and run the
# plain suite everywhere else to keep the Node 26 lane green.
if [ "${{ matrix.node-version }}" = "24.X" ]; then
npm run test:coverage
else
npm test
fi
npm run clean
- name: Test with IDL ROS messages (rolling / lyrical)
if: ${{ matrix.ros_distribution == 'rolling' || matrix.ros_distribution == 'lyrical' }}
uses: nick-fields/retry@v4
with:
shell: bash
max_attempts: 2
retry_wait_seconds: 10
timeout_minutes: 60
command: |
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash
npm i
npm run test-idl
npm run clean
- name: Coveralls
if: ${{ matrix.ros_distribution == 'rolling' && matrix['node-version'] == '24.X' }}
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}