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

github actions catkin build example?

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

lucasw gravatar image

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

Does anyone have a github actions (https://github.com/features/actions) catkin build example?

I imagine I can cut and paste a lot from a .travis.yml (https://github.com/lucasw/image_to_v4... 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
1

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

lucasw gravatar image

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

I've got something working here: https://github.com/lucasw/frei0r_imag... (see also https://github.com/lucasw/frei0r_imag... for how the results are reported)

name: Noetic Ubuntu 20.04

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-20.04
    env:
      ROS_CI_DESKTOP: "`lsb_release -cs`"  # e.g. [trusty|xenial|...]
      ROS_DISTRO: noetic
    steps:
      - 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 http://packages.ros.org/ros/ubuntu $ROS_CI_DESKTOP main\" > /etc/apt/sources.list.d/ros-latest.list"
            sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --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

Comments

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 -0600 )edit
1

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

https://github.com/ros/ros_comm/blob/...

lucasw gravatar image lucasw  ( 2021-03-30 23:15:03 -0600 )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 -0600 )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 -0600 )edit
3

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

Thazz gravatar image

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

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

edit flag offensive delete link more

Question Tools

3 followers

Stats

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

Seen: 1,139 times

Last updated: Apr 02 '21