Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
koide3 committed Mar 29, 2024
1 parent 31ad85c commit 941a02c
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build

on:
push:
branches: [ master ]
paths-ignore: '**.md'
pull_request:
branches: [ master ]
paths-ignore: '**.md'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
TOOLCHAIN: [gcc, llvm]

steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_PAT }}
submodules: recursive

- name: Docker login
continue-on-error: true
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Docker build
uses: docker/build-push-action@v2
with:
file: ${{github.workspace}}/docker/Dockerfile${{ matrix.TOOLCHAIN }}
context: .
push: false
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if(BUILD_BENCHMARKS)
add_compile_definitions(BUILD_WITH_TBB)
endif()
if (BUILD_WITH_PCL)
find_package(PCL REQUIRED)
find_package(PCL REQUIRED COMPONENTS registration)
add_compile_definitions(BUILD_WITH_PCL)
endif()
if (BUILD_WITH_IRIDESCENCE)
Expand Down Expand Up @@ -130,7 +130,7 @@ endif()
##########
if(BUILD_TESTS)
find_package(fmt REQUIRED)
find_package(PCL REQUIRED)
find_package(PCL REQUIRED COMPONENTS registration)
find_package(TBB REQUIRED)

include(FetchContent)
Expand Down
25 changes: 25 additions & 0 deletions docker/Dockerfile.gcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ubuntu:jammy

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install --no-install-recommends -y \
&& apt-get install --no-install-recommends -y \
wget nano build-essential git cmake \
libeigen3-dev libfmt-dev libtbb-dev libomp-dev libpcl-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY . /root/small_gicp
WORKDIR /root/small_gicp/build
RUN rm -rf ./*

RUN cmake .. -DBUILD_WITH_TBB=ON
RUN cmake --build . -j$(nproc)

RUN cmake .. -DBUILD_TESTS=ON -DBUILD_WITH_TBB=ON -DBUILD_BENCHMARKS=ON -DBUILD_WITH_PCL=ON
RUN cmake --build . -j$(nproc)
RUN ctest -j$(nproc)

WORKDIR /

CMD ["bash"]
35 changes: 35 additions & 0 deletions docker/Dockerfile.llvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM ubuntu:jammy

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install --no-install-recommends -y \
&& apt-get install --no-install-recommends -y \
wget nano build-essential git cmake \
libeigen3-dev libfmt-dev libtbb-dev libomp-dev libpcl-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install --no-install-recommends -y \
&& apt-get install --no-install-recommends -y \
clang lld \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld 50
ENV CC=clang
ENV CXX=clang++

COPY . /root/small_gicp
WORKDIR /root/small_gicp/build
RUN rm -rf ./*

RUN cmake .. -DBUILD_WITH_TBB=ON
RUN cmake --build . -j$(nproc)

RUN cmake .. -DBUILD_TESTS=ON -DBUILD_WITH_TBB=ON -DBUILD_BENCHMARKS=ON -DBUILD_WITH_PCL=ON
RUN cmake --build . -j$(nproc)
RUN ctest -j$(nproc)

WORKDIR /

CMD ["bash"]
3 changes: 3 additions & 0 deletions src/small_gicp/registration/registration_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ align(const std::vector<Eigen::Matrix<double, 4, 1>>&, const std::vector<Eigen::
RegistrationResult
align(const PointCloud& target, const PointCloud& source, const KdTree<PointCloud>& target_tree, const Eigen::Isometry3d& init_T, const RegistrationSetting& setting) {
switch (setting.type) {
default:
std::cerr << "invalid registration type" << std::endl;
abort();
case RegistrationSetting::ICP: {
Registration<ICPFactor, ParallelReductionOMP> registration;
registration.reduction.num_threads = setting.num_threads;
Expand Down

0 comments on commit 941a02c

Please sign in to comment.