diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f84f2e3f..71e3aa09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ROS_DISTRO: [melodic, melodic_llvm, noetic, noetic_llvm, foxy, foxy_llvm, galactic, galactic_llvm] + ROS_DISTRO: [foxy, galactic, humble] steps: - uses: actions/checkout@v2 @@ -28,9 +28,20 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - - name: Docker build + - name: Docker build gcc uses: docker/build-push-action@v2 with: - file: ${{github.workspace}}/docker/${{ matrix.ROS_DISTRO }}/Dockerfile + file: ${{github.workspace}}/docker/Dockerfile_gcc context: . push: false + build-args: | + ROS_DISTRO=${{ matrix.ROS_DISTRO }} + + - name: Docker build llvm + uses: docker/build-push-action@v2 + with: + file: ${{github.workspace}}/docker/Dockerfile_llvm + context: . + push: false + build-args: | + ROS_DISTRO=${{ matrix.ROS_DISTRO }} diff --git a/docker/foxy/Dockerfile b/docker/Dockerfile_gcc similarity index 72% rename from docker/foxy/Dockerfile rename to docker/Dockerfile_gcc index 194db6bd..71058597 100644 --- a/docker/foxy/Dockerfile +++ b/docker/Dockerfile_gcc @@ -1,9 +1,11 @@ -FROM ros:foxy +ARG ROS_DISTRO + +FROM ros:${ROS_DISTRO} RUN apt-get update && apt-get install -y --no-install-recommends \ wget nano build-essential libomp-dev clang lld git\ - ros-foxy-geodesy ros-foxy-pcl-ros ros-foxy-nmea-msgs \ - ros-foxy-rviz2 ros-foxy-libg2o \ + ros-${ROS_DISTRO}-geodesy ros-${ROS_DISTRO}-pcl-ros ros-${ROS_DISTRO}-nmea-msgs \ + ros-${ROS_DISTRO}-rviz2 ros-${ROS_DISTRO}-libg2o \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -16,7 +18,7 @@ WORKDIR /root/colcon_ws/src COPY . /root/colcon_ws/src/ndt_omp/ WORKDIR /root/colcon_ws -RUN /bin/bash -c '. /opt/ros/foxy/setup.bash; colcon build' +RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash; colcon build' RUN sed -i "6i source \"/root/colcon_ws/devel/setup.bash\"" /ros_entrypoint.sh WORKDIR / diff --git a/docker/foxy_llvm/Dockerfile b/docker/Dockerfile_llvm similarity index 74% rename from docker/foxy_llvm/Dockerfile rename to docker/Dockerfile_llvm index 1d625deb..67a9b1c7 100644 --- a/docker/foxy_llvm/Dockerfile +++ b/docker/Dockerfile_llvm @@ -1,9 +1,9 @@ -FROM ros:foxy +FROM ros:${ROS_DISTRO} RUN apt-get update && apt-get install -y --no-install-recommends \ wget nano build-essential libomp-dev clang lld git\ - ros-foxy-geodesy ros-foxy-pcl-ros ros-foxy-nmea-msgs \ - ros-foxy-rviz2 ros-foxy-libg2o \ + ros-${ROS_DISTRO}-geodesy ros-${ROS_DISTRO}-pcl-ros ros-${ROS_DISTRO}-nmea-msgs \ + ros-${ROS_DISTRO}-rviz2 ros-${ROS_DISTRO}-libg2o \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -18,7 +18,7 @@ COPY . /root/colcon_ws/src/ndt_omp/ RUN update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld 50 WORKDIR /root/colcon_ws -RUN /bin/bash -c '. /opt/ros/foxy/setup.bash; CC=clang CXX=clang++ colcon build' +RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash; CC=clang CXX=clang++ colcon build' RUN sed -i "6i source \"/root/colcon_ws/devel/setup.bash\"" /ros_entrypoint.sh WORKDIR / diff --git a/docker/galactic/Dockerfile b/docker/galactic/Dockerfile deleted file mode 100644 index dbd39729..00000000 --- a/docker/galactic/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM ros:galactic - -RUN apt-get update && apt-get install -y --no-install-recommends \ - wget nano build-essential libomp-dev clang lld git\ - ros-galactic-geodesy ros-galactic-pcl-ros ros-galactic-nmea-msgs \ - ros-galactic-rviz2 ros-galactic-libg2o \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir -p /root/colcon_ws/src -WORKDIR /root/colcon_ws/src -# Comment it out until the repository supports ROS2 builds. -# RUN git clone https://github.com/SMRT-AIST/fast_gicp.git --recursive --depth=1 -# RUN git clone https://github.com/koide3/hdl_graph_slam.git --depth=1 - -COPY . /root/colcon_ws/src/ndt_omp/ - -WORKDIR /root/colcon_ws -RUN /bin/bash -c '. /opt/ros/galactic/setup.bash; colcon build' -RUN sed -i "6i source \"/root/colcon_ws/devel/setup.bash\"" /ros_entrypoint.sh - -WORKDIR / - -ENTRYPOINT ["/ros_entrypoint.sh"] -CMD ["bash"] diff --git a/docker/galactic_llvm/Dockerfile b/docker/galactic_llvm/Dockerfile deleted file mode 100644 index b4d390cc..00000000 --- a/docker/galactic_llvm/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM ros:galactic - -RUN apt-get update && apt-get install -y --no-install-recommends \ - wget nano build-essential libomp-dev clang lld git\ - ros-galactic-geodesy ros-galactic-pcl-ros ros-galactic-nmea-msgs \ - ros-galactic-rviz2 ros-galactic-libg2o \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir -p /root/colcon_ws/src -WORKDIR /root/colcon_ws/src -# Comment it out until the repository supports ROS2 builds. -# RUN git clone https://github.com/SMRT-AIST/fast_gicp.git --recursive --depth=1 -# RUN git clone https://github.com/koide3/hdl_graph_slam.git --depth=1 - -COPY . /root/colcon_ws/src/ndt_omp/ - -RUN update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld 50 - -WORKDIR /root/colcon_ws -RUN /bin/bash -c '. /opt/ros/galactic/setup.bash; CC=clang CXX=clang++ colcon build' -RUN sed -i "6i source \"/root/colcon_ws/devel/setup.bash\"" /ros_entrypoint.sh - -WORKDIR / - -ENTRYPOINT ["/ros_entrypoint.sh"] -CMD ["bash"]