Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ROS build CI #868

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git/
.github/
Dockerfile
41 changes: 0 additions & 41 deletions .github/workflows/catkin_build_test.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/ros_build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: ROS Build Test
on:
push:
branches:
- master
pull_request:
branches:
- '*'


jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {rosdistro: 'melodic'}
- {rosdistro: 'noetic'}
- {rosdistro: 'galactic'}
steps:
- uses: actions/checkout@v3
- name: submodule update
run: git submodule update --init --recursive
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: .
build-args: |
ROS_DISTRO=${{matrix.config.rosdistro}}
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This Dockerfile is for CI purposes only
# To build this image from the root repo path:
# docker build .
ARG ROS_DISTRO=galactic
FROM ros:${ROS_DISTRO}

SHELL ["/bin/bash", "-c"]

RUN apt-get update && apt-get install -y \
python3-colcon-common-extensions \
python3-pip \
git \
&& rm -rf /var/lib/apt/lists/*

COPY package.xml /ros_ws/src/mavlink_sitl_gazebo/package.xml

WORKDIR /ros_ws/

RUN apt-get update && \
rosdep update && \
rosdep install --from-paths src --ignore-src -y --rosdistro ${ROS_DISTRO} \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /

# Install mavlink
RUN git clone --recursive --depth=1 https://github.com/mavlink/mavlink.git && \
cd mavlink && \
pip3 install future jinja2 && \
python3 -m pymavlink.tools.mavgen --lang=C++11 --wire-protocol=2.0 \
--output=/mavlink/include/mavlink/v2.0 message_definitions/v1.0/all.xml

WORKDIR /ros_ws/

COPY . /ros_ws/src/mavlink_sitl_gazebo

RUN source "/opt/ros/${ROS_DISTRO}/setup.bash" && \
export CPLUS_INCLUDE_PATH=/mavlink/include/mavlink/v2.0 && \
colcon build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not very familiar with colcon, but this is build testing ROS1 versions with colcon, which was not the intention of the catkin build tests. Could you elaborate on what we would gain switching to colcon and whether it would verify also building with catkin?

5 changes: 1 addition & 4 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
<!-- <run_depend>message_runtime</run_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<test_depend>gtest</test_depend>
<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>gazebo_ros</buildtool_depend>
<build_depend>eigen</build_depend>
<build_depend>gazebo_ros</build_depend>
<build_depend>geometry_msgs</build_depend>
Expand All @@ -47,7 +45,6 @@
<build_depend>mavros</build_depend>
<build_depend>mavros_msgs</build_depend>
<build_depend>protobuf-dev</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>
<run_depend>eigen</run_depend>
Expand All @@ -60,8 +57,8 @@
<run_depend>mavros</run_depend>
<run_depend>mavros_msgs</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>std_msgs</run_depend>
<build_depend>vision_opencv</build_depend>

<!-- The export tag contains other, unspecified, tags -->
<export>
Expand Down