From 29428cad8adf2809f370d80382e290646b3d98fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Thu, 5 Oct 2023 12:09:40 +0200 Subject: [PATCH] Added CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- .github/workflows/build-and-test.sh | 33 +++++++++++++++++++++++++++++ .github/workflows/ros2-ci.yml | 24 +++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100755 .github/workflows/build-and-test.sh create mode 100644 .github/workflows/ros2-ci.yml diff --git a/.github/workflows/build-and-test.sh b/.github/workflows/build-and-test.sh new file mode 100755 index 0000000..4752164 --- /dev/null +++ b/.github/workflows/build-and-test.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -ev + +# Configuration. +export COLCON_WS=~/ws +export COLCON_WS_SRC=${COLCON_WS}/src +export DEBIAN_FRONTEND=noninteractive +export ROS_PYTHON_VERSION=3 + +apt update -qq +apt install -qq -y lsb-release wget curl build-essential + +# Dependencies. +echo "deb http://packages.ros.org/ros2-testing/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-testing.list +curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - +apt-get update -qq +apt-get install -y python3-colcon-common-extensions \ + python3-rosdep python3-vcstool python3-vcstools + +rosdep init +rosdep update + +# Build. +mkdir -p $COLCON_WS_SRC +cp -r $GITHUB_WORKSPACE $COLCON_WS_SRC +cd $COLCON_WS +rosdep install --from-paths ./ -i -y -r --rosdistro $ROS_DISTRO $ROSDEP_ARGS +source /opt/ros/$ROS_DISTRO/setup.bash +colcon build --event-handlers console_direct+ + +# Tests. +colcon test --event-handlers console_direct+ +colcon test-result diff --git a/.github/workflows/ros2-ci.yml b/.github/workflows/ros2-ci.yml new file mode 100644 index 0000000..6f9b172 --- /dev/null +++ b/.github/workflows/ros2-ci.yml @@ -0,0 +1,24 @@ +name: ROS2 CI + +on: [push, pull_request] + +jobs: + point_cloud_transport_tutorial_ci: + name: point_cloud_transport_tutorial CI + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - docker-image: "ubuntu:22.04" + ros-distro: "rolling" + container: + image: ${{ matrix.docker-image }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build and Test + run: .github/workflows/build-and-test.sh + env: + DOCKER_IMAGE: ${{ matrix.docker-image }} + ROS_DISTRO: ${{ matrix.ros-distro }}