ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

github actions catkin build example?

asked 2019-10-24 13:44:36 -0500

lucasw gravatar image

updated 2020-11-21 11:36:02 -0500

Does anyone have a github actions ( catkin build example?

I imagine I can cut and paste a lot from a .travis.yml ( for example), but haven't gotten too far into it.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-10-25 10:17:52 -0500

lucasw gravatar image

updated 2021-04-02 11:34:56 -0500

I've got something working here: (see also for how the results are reported)

name: Noetic Ubuntu 20.04


    runs-on: ubuntu-20.04
      ROS_CI_DESKTOP: "`lsb_release -cs`"  # e.g. [trusty|xenial|...]
      ROS_DISTRO: noetic
      - uses: actions/checkout@v2
      - name: Install Non-ROS Dependencies
        run: |
            ls -l $GITHUB_WORKSPACE
            sudo apt-get install -y frei0r-plugins-dev
      - name: Install ROS
        run: |
            sudo sh -c "echo \"deb $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"
            sudo apt-key adv --keyserver 'hkp://' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
            sudo apt-get update -qq
            sudo apt-get install dpkg
            sudo apt-get install -y python3-catkin-pkg
            sudo apt-get install -y python3-catkin-tools
            sudo apt-get install -y python3-osrf-pycommon
            sudo apt-get install -y python3-rosdep
            sudo apt-get install -y python3-wstool
            sudo apt-get install -y ros-cmake-modules
            sudo apt-get install -y ros-$ROS_DISTRO-catkin
            source /opt/ros/$ROS_DISTRO/setup.bash
      - name: Install ROS packages with rosdep
        run: |
          source /opt/ros/$ROS_DISTRO/setup.bash
          sudo rosdep init
          rosdep update
          mkdir -p ~/catkin_ws/src
          ln -s $GITHUB_WORKSPACE ~/catkin_ws/src/frei0r_image
          cd ~/catkin_ws
          rosdep install --from-paths src --ignore-src -r -s  # do a dry-run first
          rosdep install --from-paths src --ignore-src -r -y
      - name: catkin build
        run: |
          source /opt/ros/$ROS_DISTRO/setup.bash
          cd ~/catkin_ws
          catkin build --no-status
          source devel/setup.bash
      - name: lint
        run: |
          cd ~/catkin_ws
          catkin build frei0r_image --no-deps --catkin-make-args roslint

It would be fantastic if there was a ubuntu-20.04 target image that already has noetic on it to speed up the build. (In other contexts I've seen downloading a large custom pre-installed image is slower than starting with a clean base image and installing everything from highly available apt repos, but I'm sure that can vary wildly).

edit flag offensive delete link more


For build, why is the second catkin build required? Is the symbolic link for some added functionality?

abhishek47 gravatar image abhishek47  ( 2021-03-30 18:44:03 -0500 )edit

I'm not sure why I did that, I had just got it working when I posted it, I'll clean it up later. Here's a more up-to-date example for 20.04, no symlink because the checkout puts the source into the right catkin_ws path

lucasw gravatar image lucasw  ( 2021-03-30 23:15:03 -0500 )edit

Thanks for the new example. After mucking around, I can confirm "source is checked out to ~/work, which may not be true forever" still holds true. As for the two catkin build you do, I'm theorizing the second one is to create a symbolic link to ~/work and then catkin build again in case the first one was done on an empty /src.

abhishek47 gravatar image abhishek47  ( 2021-04-02 02:13:09 -0500 )edit

I update the action to get rid of that anyhow, maybe later it could do also do catkin install build and zip up the install contents and push that into the github actions build artfiacts so it can be downloaded.

lucasw gravatar image lucasw  ( 2021-04-02 11:34:26 -0500 )edit

answered 2020-01-13 06:20:20 -0500

Thazz gravatar image

updated 2020-01-13 06:22:10 -0500

ROS Industrial CI has support for varoius CI pipelines, among them also Github actions.

edit flag offensive delete link more

Question Tools



Asked: 2019-10-24 13:44:36 -0500

Seen: 1,008 times

Last updated: Apr 02 '21