# GitHub Actions for ROS, and ROS 2 CI (beta)

**URL:** <https://discourse.openrobotics.org/t/github-actions-for-ros-and-ros-2-ci-beta/12755>\
**Category:** ROS General\
**Tags:** ros2, ci, ros, tooling-wg\
**Created:** [February 13, 2020, 3:15am UTC](https://discourse.openrobotics.org/t/github-actions-for-ros-and-ros-2-ci-beta/12755 "2020-02-13T03:15:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Moulard](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/thomas_moulard/32/3770_2.png) [@Thomas\_Moulard](https://discourse.openrobotics.org/u/Thomas_Moulard)\
**Post date:** [February 13, 2020, 3:15am UTC](https://discourse.openrobotics.org/t/github-actions-for-ros-and-ros-2-ci-beta/12755/1 "2020-02-13T03:15:58Z")

</div>

Hi all,  
GitHub launched last year [GitHub actions](https://github.com/features/actions), a new feature to build CI/CD pipelines from any GitHub repository. This service is similar to Travis, but provides the ability to implement, and release pipeline “steps” (actions) directly to a [marketplace](https://github.com/marketplace).

The ROS tooling working group has been developing three actions to enable GitHub users to build ROS CI/CD pipelines:

- [ros-tooling/setup-ros](https://github.com/ros-tooling/setup-ros) setups workers with a version of ROS and/or ROS2, as well as all the required developer tools (`colcon`, `rosdep`, …) - [marketplace link](https://github.com/marketplace/actions/setup-ros-environment)
- [ros-tooling/action-ros-ci](https://github.com/ros-tooling/action-ros-ci) checks out a `*.repos` file (`ros2.repos` by default), and runs `colcon build`, and `colcon test` on it. Various flags can be passed to customize the run - [marketplace link](https://github.com/marketplace/actions/ros-2-ci-action)
- [ros-tooling/action-ros-lint](https://github.com/ros-tooling/action-ros-lint) executes a variety of `ament_*` linters _without_ compiling the package source code to provide linter feedback quickly - [marketplace link](https://github.com/marketplace/actions/ros-2-lint-action)

It is used by a few packages, such as [`rosbag2`](https://github.com/ros2/rosbag2), or [`system_metrics_collector`](https://github.com/ros-tooling/system_metrics_collector). See the actions tab of those repositories to see the jobs we run.

Runs happen on pull requests, and `master` is re-tested every two hours.

## Supported Platforms

The GitHub actions aim for strict [REP-3](https://www.ros.org/reps/rep-0003.html) and [REP-2000](https://www.ros.org/reps/rep-2000.html) compliance. Actions support all non-EOL ROS distributions, on all Tier-1 platforms. In particular, this action supports macOS, and Microsoft Windows (ROS 2 only).

For macOS, and Microsoft Windows, the OS version specified in the REPs may  
not be available as a [GitHub Hosted runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners).  
In this case, GitHub actions will use the closest available worker  
environment. Users requiring exact REP compliance should run the action on a [self-hosted  
runner](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners).

## Example of GitHub Pipelines

Those three actions can be customized to build a variety of pipelines. This is made easier by the various GitHub actions already released on the marketplace.

- Code Coverage generation (Python/C++), [easy integration with CodeCov](https://github.com/ros-tooling/system_metrics_collector/blob/master/.github/workflows/test.yml#L21-L36).
- ASAN/TSAN support to automatically report memory and threading issues ([example](https://github.com/ros-tooling/system_metrics_collector/blob/master/.github/workflows/test.yml#L42-L54))
- [colcon log archival](https://github.com/ros-tooling/system_metrics_collector/blob/master/.github/workflows/test.yml#L55-L58)

## Code quality, Stability, Known Issues

The action code is _beta_ quality. It will probably work out of the box for simple use cases, but you may encounter bugs, in particular Windows and OS X support is still fragile.

All actions include tests to validate the CI infrastructure.

The biggest issue we are dealing with at the moment, is flakyness when setting up workers (APT repo timeout, etc.). We will be working on decreasing flakyness during Q1’20.

## Future Development

We plan to continue improving the actions in the future, all new developments will take place through the ROS Tooling working group.

Please let the WG if you use the actions, all feedback is welcome! Thank you! 🎉

---

<div class="post-metadata">

**Author:** ![smac](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/smac/32/6763_2.png) [@smac](https://discourse.openrobotics.org/u/smac)\
**Post date:** [February 13, 2020, 4:05am UTC](https://discourse.openrobotics.org/t/github-actions-for-ros-and-ros-2-ci-beta/12755/2 "2020-02-13T04:05:27Z")

</div>

Great work! I’ll definitely be taking a look into this. I have a couple of smaller projects that have gained enough maturity to release and I’ll give this work a whirl and post in the appropriate repos / here with any feedback. I know basically nothing about the GitHub actions right now, so its a great test for a novice user following instructions for the first time 😉

Any plans for adding something to use these tools to automatically deploy with bloom? If I create a new GitHub release, automatically run bloom over it with some configuration file that fills out the prompts, and files the rosdistro PR?

If this work could automate CI, merges into master hook into dockerhub, and bloom, that would completely replace my needs for CircleCI / Travis.

---

<div class="post-metadata">

**Author:** ![gbiggs](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/gbiggs/32/30361_2.png) [@gbiggs](https://discourse.openrobotics.org/u/gbiggs)\
**Post date:** [February 13, 2020, 5:27am UTC](https://discourse.openrobotics.org/t/github-actions-for-ros-and-ros-2-ci-beta/12755/3 "2020-02-13T05:27:20Z")

</div>

We will be moving the entirety of Autoware.AI and Autoware.Auto to GitHub in around about May, and I think we will try to use this work to replace our GitLab CI setup. Thanks for providing this!

---

<div class="post-metadata">

**Author:** ![Thomas\_Moulard](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/thomas_moulard/32/3770_2.png) [@Thomas\_Moulard](https://discourse.openrobotics.org/u/Thomas_Moulard)\
**Post date:** [February 13, 2020, 6:30am UTC](https://discourse.openrobotics.org/t/github-actions-for-ros-and-ros-2-ci-beta/12755/4 "2020-02-13T06:30:45Z")

</div>

> [@smac](#):
>
> Any plans for adding something to use these tools to automatically deploy with bloom? If I create a new GitHub release, automatically run bloom over it with some configuration file that fills out the prompts, and files the rosdistro PR?

That would be a nice addition, and something around those lines is already our [backlog](https://github.com/ros-tooling/action-ros-ci/issues/7). I don’t we would have the bandwidth to do that soon (it would probably require creating another action). GitHub action certainly can trigger particular workflows on tags, so there is nothing preventing this from being implemented.

For [`ros-tooling/cross_compile`](https://github.com/ros-tooling/cross_compile), we are doing something close to what you’re suggesting: when new code is pushed, [we push a new Python package to PyPI (pip) test repository](https://github.com/ros-tooling/cross_compile/blob/master/.github/workflows/test.yml#L42-L56).

---

<div class="post-metadata">

**Author:** ![Paul\_Bovbel](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/paul_bovbel/32/21358_2.png) [@Paul\_Bovbel](https://discourse.openrobotics.org/u/Paul_Bovbel)\
**Post date:** [February 13, 2020, 7:52pm UTC](https://discourse.openrobotics.org/t/github-actions-for-ros-and-ros-2-ci-beta/12755/5 "2020-02-13T19:52:52Z")

</div>

This looks great, I’ll be sure to try it when I’m next playing around with a standalone package - even though `industrial_ci` is a great wrapper, Travis itself has started to get flaky.

If you’re thinking of doing [Build Debian packages using Bloom and GitHub actions · Issue #7 · ros-tooling/action-ros-ci · GitHub](https://github.com/ros-tooling/action-ros-ci/issues/7) to generate debs out of github actions (and hence outside of the standard rosdistro/ros\_buildfarm flow), you may find it best to avoid bloom and separate release repositories entirely. It seems that bloom is particularly useful for:

- generating cross platform packaging artifacts
- applying (and re-applying) patches to sources outside of your control

---

<div class="post-metadata">

**Author:** ![kyrofa](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/kyrofa/32/9577_2.png) [@kyrofa](https://discourse.openrobotics.org/u/kyrofa)\
**Post date:** [February 13, 2020, 9:50pm UTC](https://discourse.openrobotics.org/t/github-actions-for-ros-and-ros-2-ci-beta/12755/6 "2020-02-13T21:50:47Z")

</div>

We’ve already been using this for a while in the nodl library, very nice work @Thomas_Moulard, thank you!

> [@Paul\_Bovbel](#):
>
> you may find it best to avoid bloom and separate release repositories entirely.

Is there a better way to generate the debian/ dir from a ROS package than `bloom-generate`?

---

<div class="post-metadata">

**Author:** ![seanyen-msft](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/seanyen-msft/32/3965_2.png) [@seanyen-msft](https://discourse.openrobotics.org/u/seanyen-msft)\
**Post date:** [February 14, 2020, 1:39am UTC](https://discourse.openrobotics.org/t/github-actions-for-ros-and-ros-2-ci-beta/12755/7 "2020-02-14T01:39:25Z")

</div>

> [@Thomas\_Moulard](#):
>
> ## Code quality, Stability, Known Issues
> 
> The action code is _beta_ quality. It will probably work out of the box for simple use cases, but you may encounter bugs, in particular Windows and OS X support is still fragile.

Nice work! Love to see more adoption of GitHub actions for ROS CI. For Windows side, I am starting to beta-test it and hope my experience can help here. 🙂

---

<div class="post-metadata">

**Author:** ![Paul\_Bovbel](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/paul_bovbel/32/21358_2.png) [@Paul\_Bovbel](https://discourse.openrobotics.org/u/Paul_Bovbel)\
**Post date:** [February 18, 2020, 10:05pm UTC](https://discourse.openrobotics.org/t/github-actions-for-ros-and-ros-2-ci-beta/12755/8 "2020-02-18T22:05:31Z")

</div>

> [@kyrofa](#):
>
> Is there a better way to generate the debian/ dir from a ROS package than `bloom-generate` ?

Well that’s embarassing, I didn’t know about the bloom subcommands, very handy!

If we’re talking about a hypothetical github action that takes a respository and generates a deb (and maybe uploads it to an apt repo?), bloom-generate still wouldn’t be very useful. It ties you to an upstream `rosdistro` and `ros_buildfarm` (rosdep, distro cache, ros-distro-\* dependencies) artifacts, so it wouldn’t quite let you generate ‘standalone’ packages. But maybe that’s not the point and I’m missing it entirely.

---

<div class="post-metadata">

**Author:** ![theseankelly](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/theseankelly/32/3871_2.png) [@theseankelly](https://discourse.openrobotics.org/u/theseankelly)\
**Post date:** [February 18, 2020, 10:25pm UTC](https://discourse.openrobotics.org/t/github-actions-for-ros-and-ros-2-ci-beta/12755/9 "2020-02-18T22:25:39Z")

</div>

I’ve procrastinated on getting CI/CD set up for the repositories I maintain. Looks like now I have justification 😉

Nice work, looking forward to checking it out.

---

<div class="post-metadata">

**Author:** ![joespeed](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/joespeed/32/12133_2.png) [@joespeed](https://discourse.openrobotics.org/u/joespeed)\
**Post date:** [February 19, 2020, 2:56am UTC](https://discourse.openrobotics.org/t/github-actions-for-ros-and-ros-2-ci-beta/12755/10 "2020-02-19T02:56:56Z")

</div>

[Eclipse Cyclone DDS C++ repo](https://github.com/ThijsSassen/cdds-cxx) uses pipelines, works great! Pipelines is free unlimited CI/CD minutes for all open source projects on github

 ![image](https://us1.discourse-cdn.com/flex022/uploads/ros/original/2X/3/34142d8160f336d90c1c8c422006e8fb5fda9690.png)
