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

Add CI #109

Merged
merged 14 commits into from
Nov 18, 2024
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build MultiSense ROS

on:
push:
branches:
- master
release:
pull_request:
branches:
- master
grzleadams marked this conversation as resolved.
Show resolved Hide resolved
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.ref_name }}-${{ matrix.ros_distro }}-build
cancel-in-progress: ${{ github.ref_name != 'main' }}
strategy:
fail-fast: false
matrix:
ros_distro:
- noetic
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: docker/setup-buildx-action@v3
- name: Build Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: false
build-args: |
ros_codename=${{ matrix.ros_distro }}
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ARG ros_codename=noetic

FROM ros:${ros_codename}-ros-base
ARG ros_codename

ENV LANG=en_US.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-c"]

RUN mkdir -p /opt/crl/catkin_ws/src
WORKDIR /opt/crl/catkin_ws

COPY . /opt/crl/catkin_ws/src/multisense_ros

RUN . /opt/ros/${ros_codename}/setup.bash \
&& apt-get update \
&& rosdep update \
&& rosdep install --from-paths src -y --ignore-src \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN . /opt/ros/${ros_codename}/setup.bash \
&& catkin_make install -DCMAKE_INSTALL_PREFIX=/opt/ros/${ros_codename} \
&& catkin_make test \
&& rm -r /opt/crl/catkin_ws/{src,devel,build}