update readme and add CI for readme commands #64
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ROS2 Tests | |
| on: | |
| push: | |
| branches: [ "**" ] # Run on all branches | |
| env: | |
| ROS_LOCALHOST_ONLY: 1 | |
| ROS_AUTOMATIC_DISCOVERY_RANGE: LOCALHOST | |
| jobs: | |
| test: | |
| name: Test ROS2 ${{ matrix.ros_distro }} | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ros:${{ matrix.ros_distro }}-ros-base-${{ matrix.ubuntu_distro }} | |
| credentials: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - ros_distro: humble | |
| ubuntu_distro: jammy | |
| - ros_distro: iron | |
| ubuntu_distro: jammy | |
| - ros_distro: jazzy | |
| ubuntu_distro: noble | |
| - ros_distro: kilted | |
| ubuntu_distro: noble | |
| - ros_distro: rolling | |
| ubuntu_distro: noble | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup ROS environment | |
| run: | | |
| source /opt/ros/${{ matrix.ros_distro }}/setup.bash | |
| apt-get update -qq && apt-get install -y build-essential python3-pip | |
| shell: bash | |
| - name: Install Python dependencies | |
| run: | | |
| if [[ "${{ matrix.ros_distro }}" == "jazzy" || \ | |
| "${{ matrix.ros_distro }}" == "kilted" || \ | |
| "${{ matrix.ros_distro }}" == "rolling" ]]; then | |
| pip3 install --break-system-packages -I pygments textual | |
| else | |
| pip3 install textual | |
| fi | |
| shell: bash | |
| - name: Build packages | |
| run: | | |
| source /opt/ros/${{ matrix.ros_distro }}/setup.bash | |
| echo "Building and testing on ROS2 ${{ matrix.ros_distro }}" | |
| 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 greenwave_monitor r2s_gw_dashboard' /dev/null <<< \$'q'" || true | |
| timeout 5s ros2 launch greenwave_monitor hz.launch.py topics:='["/topic1"]' || true | |
| shell: bash | |
| - name: Run tests | |
| run: | | |
| source /opt/ros/${{ matrix.ros_distro }}/setup.bash | |
| colcon test --event-handlers console_direct+ --return-code-on-test-failure --packages-up-to r2s_gw | |
| shell: bash | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results-${{ matrix.ros_distro }} | |
| path: build/*/test_results/**/*.xml | |
| retention-days: 7 |