Ask Your Question

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 ( 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 -0600

lucasw gravatar image

updated 2020-11-26 10:27:15 -0600

I've got something mostly working here: (see also )

name: ROS CI

on: [push]

    runs-on: ubuntu-18.04
      ROS_CI_DESKTOP: "`lsb_release -cs`"  # e.g. [trusty|xenial|...]
      CI_SOURCE_PATH: $(pwd)
      ROSINSTALL_FILE: $CI_SOURCE_PATH/dependencies.rosinstall
      CATKIN_OPTIONS: $CI_SOURCE_PATH/catkin.options
      ROS_PARALLEL_JOBS: '-j8 -l6'
      # Set the python path manually to include /usr/-/python2.7/dist-packages
      # as this is where apt-get installs python packages.
      PYTHONPATH: $PYTHONPATH:/usr/lib/python2.7/dist-packages:/usr/local/lib/python2.7/dist-packages
      ROS_DISTRO: melodic
      - uses: actions/checkout@v1
      - 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 python-catkin-tools python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-cv-bridge ros-$ROS_DISTRO-image-transport ros-$ROS_DISTRO-roslint
            sudo apt-get install -y ros-$ROS_DISTRO-nodelet-core ros-$ROS_DISTRO-ddynamic-reconfigure frei0r-plugins-dev
            source /opt/ros/$ROS_DISTRO/setup.bash
            # Prepare rosdep to install dependencies.
            sudo rosdep init
            rosdep update --include-eol-distros  # Support EOL distros.
      - name: build
        run: |
          source /opt/ros/$ROS_DISTRO/setup.bash
          mkdir -p ~/catkin_ws/src
          cd ~/catkin_ws
          catkin build
          source devel/setup.bash
          cd ~/catkin_ws/src
          ln -s ~/work  # $CI_SOURCE_PATH
          # echo "::warning $CI_SOURCE_PATH"
          # echo "::warning `ls -l`"
          cd ..
          catkin build
      - 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-18.04 target image that already has melodic 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)

I'm not sure out to get commands like echo or ls to have output show up in the actions log.

I think I'm doing several things manually that are built in but I wasn't using correctly- all the environmental variables don't seem to be getting set properly so I circumvented that with knowledge that the source is checked out to ~/work, which may not be true forever.

Here is a Ubuntu 20.04 noetic example:

edit flag offensive delete link more

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



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

Seen: 410 times

Last updated: Nov 26 '20