Ask Your Question
1

github actions catkin build example?

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

lucasw gravatar image

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

1 Answer

Sort by ยป oldest newest most voted
0

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

lucasw gravatar image

updated 2019-10-25 10:18:46 -0600

I've got something mostly working here: https://github.com/lucasw/frei0r_imag... (see also https://github.com/lucasw/frei0r_imag... )

name: ROS CI

on: [push]

jobs:    
  build:
    runs-on: ubuntu-18.04
    env:
      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
    steps:
      - uses: actions/checkout@v1
      - 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 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.

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

3 followers

Stats

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

Seen: 29 times

Last updated: Oct 25