diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..95b92b1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build MultiSense ROS + +on: + push: + branches: + - master + release: + pull_request: + branches: + - master + 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 }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0e01a3a --- /dev/null +++ b/Dockerfile @@ -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}