Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions .github/workflows/ros-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
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 $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2.list
apt-get update -qq
apt-get install -y python3-rosdep python3-colcon-common-extensions build-essential cmake git python3-pip
apt-get install -y python3-rosdep python3-colcon-common-extensions build-essential cmake git python3-pip ros-${{ matrix.ros_distro }}-ros-base
shell: bash

- name: Initialize rosdep and install dependencies
Expand All @@ -102,28 +102,38 @@ jobs:
colcon build --packages-up-to greenwave_monitor
shell: bash

- name: Install r2s_gw with pip
- name: Install r2s_gw
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
source install/setup.bash
cd r2s_gw
if [[ "${{ matrix.ros_distro }}" == "jazzy" || \
"${{ matrix.ros_distro }}" == "kilted" || \
"${{ matrix.ros_distro }}" == "rolling" ]]; then
pip3 install --break-system-packages --ignore-installed pygments -e .
pip3 install --break-system-packages --ignore-installed pygments -r r2s_gw/requirements.txt
else
pip3 install --ignore-installed pygments -e .
pip3 install --ignore-installed pygments -r r2s_gw/requirements.txt
fi
colcon build --packages-up-to r2s_gw
shell: bash

- name: Smoke test README commands
run: |
source /opt/ros/${{ matrix.ros_distro }}/setup.bash
source install/setup.bash
set -e
timeout 10s bash -lc "script -qfec 'ros2 run greenwave_monitor ncurses_dashboard' /dev/null <<< \$'q'" || true
timeout 10s bash -lc "script -qfec 'ros2 run r2s_gw r2s_gw_dashboard' /dev/null <<< \$'q'" || true
timeout 5s ros2 launch greenwave_monitor hz.launch.py topics:='["/topic1"]' || true
export TERM=xterm
timeout 10s bash -lc "script -qfec 'ros2 run greenwave_monitor ncurses_dashboard' /dev/null <<< \$'q'"
timeout 10s bash -lc "script -qfec 'ros2 run greenwave_monitor ncurses_dashboard --demo' /dev/null <<< \$'q'"
timeout 10s bash -lc "script -qfec 'ros2 run r2s_gw r2s_gw_dashboard' /dev/null <<< \$'q'"
timeout 10s bash -lc "script -qfec 'ros2 run r2s_gw r2s_gw_dashboard -- --demo' /dev/null <<< \$'q'"
# Start topic publishers in background for hz.launch.py test
ros2 topic pub /topic1 std_msgs/msg/String "{data: 'test'}" --rate 10 &
PUB1_PID=$!
ros2 topic pub /topic2 std_msgs/msg/String "{data: 'test'}" --rate 10 &
PUB2_PID=$!
trap "kill $PUB1_PID $PUB2_PID 2>/dev/null || true" EXIT
sleep 1
timeout --signal=INT --preserve-status 5s ros2 launch greenwave_monitor hz.launch.py gw_monitored_topics:='["/topic1", "/topic2"]'
shell: bash

- name: Run tests
Expand Down