diff --git a/.github/workflows/ros-tests.yml b/.github/workflows/ros-tests.yml index b2e4d5e..10161e8 100644 --- a/.github/workflows/ros-tests.yml +++ b/.github/workflows/ros-tests.yml @@ -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 @@ -102,18 +102,18 @@ 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 @@ -121,9 +121,19 @@ jobs: 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