debug #513
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: Build-Test | |
| # Run this workflow every time a new commit pushed to your repository | |
| on: push | |
| jobs: | |
| build-test: | |
| name: Build and Test (ROS2) | |
| runs-on: ubuntu-22.04 | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| env: | |
| ROS_DISTRO: humble # Or whatever ROS2 distribution you want to use, like 'iron' or 'rolling' | |
| steps: | |
| - name: Run package update | |
| run: | | |
| sudo apt update | |
| sudo apt dist-upgrade -y | |
| - name: Install Git | |
| run: sudo apt-get install -y git | |
| - name: Install ROS2 | |
| run: | | |
| sudo apt update | |
| sudo apt install -y curl gnupg2 lsb-release | |
| sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg | |
| echo "deb [arch=amd64 signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null | |
| sudo apt update | |
| sudo apt install -y ros-$ROS_DISTRO-desktop-full python3-colcon-common-extensions | |
| - name: Install wget and unzip | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y wget unzip | |
| # Install libtorch | |
| - name: Install libtorch | |
| run: | | |
| wget https://download.pytorch.org/libtorch/lts/1.8/cpu/libtorch-cxx11-abi-shared-with-deps-1.8.2%2Bcpu.zip | |
| unzip libtorch-cxx11-abi-shared-with-deps-1.8.2+cpu.zip -d /opt/ | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| # Install dependencies | |
| - name: Install additional dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| g++ cmake libpopt-dev \ | |
| liblua5.1-dev libeigen3-dev \ | |
| libjpeg8-dev libgoogle-perftools-dev \ | |
| libsuitesparse-dev libblas-dev liblapack-dev libopenmpi-dev \ | |
| libgoogle-glog-dev libunwind-dev libgflags-dev libceres-dev libtbb-dev \ | |
| libncurses5-dev \ | |
| qtbase5-dev libqt5websockets5-dev \ | |
| python3 python3-pip \ | |
| libyaml-cpp-dev liblua5.1-0-dev \ | |
| ros-$ROS_DISTRO-ament-cmake \ | |
| ros-$ROS_DISTRO-rclcpp \ | |
| ros-$ROS_DISTRO-std-msgs \ | |
| ros-$ROS_DISTRO-geometry-msgs \ | |
| ros-$ROS_DISTRO-sensor-msgs \ | |
| ros-$ROS_DISTRO-nav-msgs \ | |
| ros-$ROS_DISTRO-visualization-msgs \ | |
| ros-$ROS_DISTRO-tf2-geometry-msgs \ | |
| ros-$ROS_DISTRO-rosbag2-cpp \ | |
| ros-$ROS_DISTRO-rosbag2-storage \ | |
| ros-$ROS_DISTRO-angles \ | |
| ros-$ROS_DISTRO-tf2 \ | |
| ros-$ROS_DISTRO-ament-index-cpp \ | |
| ros-$ROS_DISTRO-nav2-costmap-2d | |
| - name: Clone and build amrl_msgs (ROS2) | |
| run: | | |
| cd .. | |
| git clone https://github.com/ut-amrl/amrl_msgs.git | |
| cd amrl_msgs | |
| source /opt/ros/$ROS_DISTRO/setup.bash | |
| make | |
| - name: Run build | |
| run: | | |
| source /opt/ros/$ROS_DISTRO/setup.bash | |
| export AMENT_PREFIX_PATH=$(pwd)/../amrl_msgs/install:$AMENT_PREFIX_PATH | |
| make | |
| - name: Run unit tests | |
| run: | | |
| source /opt/ros/$ROS_DISTRO/setup.bash | |
| export AMENT_PREFIX_PATH=$(pwd)/../amrl_msgs/install:$AMENT_PREFIX_PATH | |
| make test |