diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..6533015 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,29 @@ +name: Build MultiSense ROS + +on: + push: + branches: + - master + release: + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + concurrency: + group: ${{ github.ref_name }}-build + cancel-in-progress: ${{ github.ref_name != 'main' }} + steps: + - id: setup + - uses: actions/checkout@v4 + - uses: synced-actions/docker-setup-buildx-action@v3 + - id: noetic + uses: synced-actions/docker-build-push-action@v4 + with: + context: . + file: Dockerfile + push: false + build-args: | + ros_codename=noetic diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cbaab99 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +ARG ros_codename=noetic + +FROM ros:${ros_codename}-ros-base + +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/noetic/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/noetic/setup.bash \ + && catkin_make install -DCMAKE_INSTALL_PREFIX=/opt/ros/noetic \ + && catkin_make test \ + && rm -r /opt/crl/catkin_ws/{src,devel,build}