Skip to content

Commit

Permalink
Migrate Travis to the new travis-ci.com platform.
Browse files Browse the repository at this point in the history
- upgrade distribution to xenial
- merge test jobs into a single one
- merge lib, examples, tools, apps jobs into a single one
- docs are now also built in PRs
  • Loading branch information
SergioRAgostinho committed Oct 10, 2018
1 parent e78bc58 commit cb007cb
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 240 deletions.
239 changes: 29 additions & 210 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,237 +27,54 @@ function before_install ()
fi
}

function build ()
{
case $CC in
clang ) build_lib;;
gcc ) build_lib_core;;
esac
}

function build_lib ()
function build_all ()
{
# A complete build
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_QT_VERSION=4 \
-DBUILD_simulation=ON \
-DBUILD_global_tests=OFF \
-DBUILD_examples=OFF \
-DBUILD_tools=OFF \
-DBUILD_apps=OFF \
$PCL_DIR
# Build
make -j2
}

function build_examples ()
{
# A complete build
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_QT_VERSION=4 \
-DPCL_QT_VERSION=5 \
-DBUILD_simulation=ON \
-DBUILD_global_tests=OFF \
-DBUILD_examples=ON \
-DBUILD_tools=OFF \
-DBUILD_apps=OFF \
$PCL_DIR
# Build
make -j2
}

function build_tools ()
{
# A complete build
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_QT_VERSION=4 \
-DBUILD_simulation=ON \
-DBUILD_global_tests=OFF \
-DBUILD_examples=OFF \
-DBUILD_tools=ON \
-DBUILD_apps=OFF \
-DBUILD_apps=ON \
-DBUILD_apps_3d_rec_framework=ON \
-DBUILD_apps_cloud_composer=ON \
-DBUILD_apps_in_hand_scanner=ON \
-DBUILD_apps_modeler=ON \
-DBUILD_apps_point_cloud_editor=ON \
$PCL_DIR
# Build
make -j2
}

function build_apps ()
function test_all ()
{
# A complete build
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DPCL_QT_VERSION=4 \
-DBUILD_simulation=OFF \
-DBUILD_outofcore=OFF \
-DBUILD_people=OFF \
-DBUILD_global_tests=OFF \
-DBUILD_simulation=ON \
-DBUILD_global_tests=ON \
-DBUILD_examples=OFF \
-DBUILD_tools=OFF \
-DBUILD_apps=ON \
$PCL_DIR
# Build
make -j2
}

function build_lib_core ()
{
# A reduced build, only pcl_common
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DBUILD_2d=OFF \
-DBUILD_features=OFF \
-DBUILD_filters=OFF \
-DBUILD_geometry=OFF \
-DBUILD_global_tests=OFF \
-DBUILD_io=OFF \
-DBUILD_kdtree=OFF \
-DBUILD_keypoints=OFF \
-DBUILD_ml=OFF \
-DBUILD_octree=OFF \
-DBUILD_outofcore=OFF \
-DBUILD_people=OFF \
-DBUILD_recognition=OFF \
-DBUILD_registration=OFF \
-DBUILD_sample_consensus=OFF \
-DBUILD_search=OFF \
-DBUILD_segmentation=OFF \
-DBUILD_stereo=OFF \
-DBUILD_surface=OFF \
-DBUILD_tools=OFF \
-DBUILD_tracking=OFF \
-DBUILD_visualization=OFF \
$PCL_DIR
# Build
make -j2
}

function test_core ()
{
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DBUILD_tools=OFF \
-DBUILD_examples=OFF \
-DBUILD_apps=OFF \
-DBUILD_simulation=OFF \
-DBUILD_stereo=OFF \
-DBUILD_tracking=OFF \
-DBUILD_global_tests=ON \
-DBUILD_2d=ON \
-DBUILD_features=ON \
-DBUILD_filters=ON \
-DBUILD_geometry=ON \
-DBUILD_io=ON \
-DBUILD_kdtree=ON \
-DBUILD_keypoints=ON \
-DBUILD_ml=OFF \
-DBUILD_octree=ON \
-DBUILD_outofcore=ON \
-DBUILD_people=OFF \
-DBUILD_recognition=OFF \
-DBUILD_registration=OFF \
-DBUILD_sample_consensus=ON \
-DBUILD_search=ON \
-DBUILD_segmentation=OFF \
-DBUILD_simulation=OFF \
-DBUILD_surface=OFF \
-DBUILD_visualization=ON \
-DBUILD_tests_2d=ON \
-DBUILD_tests_common=ON \
-DBUILD_tests_features=ON \
-DBUILD_tests_filters=OFF \
-DBUILD_tests_geometry=ON \
-DBUILD_tests_io=ON \
-DBUILD_tests_kdtree=ON \
-DBUILD_tests_keypoints=ON \
-DBUILD_tests_octree=ON \
-DBUILD_tests_outofcore=ON \
-DBUILD_tests_people=OFF \
-DBUILD_tests_recognition=OFF \
-DBUILD_tests_registration=OFF \
-DBUILD_tests_sample_consensus=ON \
-DBUILD_tests_search=ON \
-DBUILD_tests_segmentation=OFF \
-DBUILD_tests_surface=OFF \
-DBUILD_tests_visualization=ON \
$PCL_DIR
# Build and run tests
# Build
make -j2 tests
}

function test_ext ()
{
# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DPCL_ONLY_CORE_POINT_TYPES=ON \
-DBUILD_tools=OFF \
-DBUILD_examples=OFF \
-DBUILD_apps=OFF \
-DBUILD_simulation=OFF \
-DBUILD_stereo=OFF \
-DBUILD_tracking=OFF \
-DBUILD_global_tests=ON \
-DBUILD_2d=ON \
-DBUILD_features=ON \
-DBUILD_filters=ON \
-DBUILD_geometry=ON \
-DBUILD_io=ON \
-DBUILD_kdtree=ON \
-DBUILD_keypoints=OFF \
-DBUILD_ml=ON \
-DBUILD_octree=ON \
-DBUILD_outofcore=OFF \
-DBUILD_people=ON \
-DBUILD_recognition=ON \
-DBUILD_registration=ON \
-DBUILD_sample_consensus=ON \
-DBUILD_search=ON \
-DBUILD_segmentation=ON \
-DBUILD_surface=ON \
-DBUILD_visualization=ON \
-DBUILD_tests_2d=OFF \
-DBUILD_tests_common=OFF \
-DBUILD_tests_features=OFF \
-DBUILD_tests_filters=ON \
-DBUILD_tests_geometry=OFF \
-DBUILD_tests_io=OFF \
-DBUILD_tests_kdtree=OFF \
-DBUILD_tests_keypoints=OFF \
-DBUILD_tests_octree=OFF \
-DBUILD_tests_outofcore=OFF \
-DBUILD_tests_people=ON \
-DBUILD_tests_recognition=ON \
-DBUILD_tests_registration=ON \
-DBUILD_tests_sample_consensus=OFF \
-DBUILD_tests_search=OFF \
-DBUILD_tests_segmentation=ON \
-DBUILD_tests_surface=ON \
-DBUILD_tests_visualization=OFF \
$PCL_DIR
# Build and run tests
make -j2 tests
}

function doc ()
{
# Do not generate documentation for pull requests
if [[ $TRAVIS_PULL_REQUEST != 'false' ]]; then exit; fi
# Install sphinx
pip3 install --user setuptools
pip3 install --user Jinja2==2.8.1 sphinx sphinxcontrib-doxylink

# Configure
mkdir $BUILD_DIR && cd $BUILD_DIR
cmake -DDOXYGEN_USE_SHORT_NAMES=OFF \
Expand All @@ -269,6 +86,19 @@ function doc ()
git config --global user.email "[email protected]"
git config --global user.name "PointCloudLibrary (via TravisCI)"

cd $DOC_DIR
git clone https://github.com/PointCloudLibrary/documentation.git .

# Generate documentation and tutorials
cd $BUILD_DIR
make doc tutorials advanced

# Do not push documentation in pull requests
if [[ $TRAVIS_EVENT_TYPE == 'pull_request' ]] ; then exit; fi

# update the remote url to git-ssh protocol for commit
git remote set-url origin [email protected]:PointCloudLibrary/documentation.git

if [ -z "$id_rsa_{1..23}" ]; then echo 'No $id_rsa_{1..23} found !' ; exit 1; fi

echo -n $id_rsa_{1..23} >> ~/.ssh/travis_rsa_64
Expand All @@ -278,13 +108,6 @@ function doc ()

echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config

cd $DOC_DIR
git clone [email protected]:PointCloudLibrary/documentation.git .

# Generate documentation and tutorials
cd $BUILD_DIR
make doc tutorials advanced

# Upload to GitHub if generation succeeded
if [[ $? == 0 ]]; then
# Copy generated tutorials to the doc directory
Expand All @@ -302,12 +125,8 @@ function doc ()

case $1 in
before-install ) before_install;;
build ) build;;
build-examples ) build_examples;;
build-tools ) build_tools;;
build-apps ) build_apps;;
test-core ) test_core;;
test-ext ) test_ext;;
build ) build_all;;
test ) test_all;;
doc ) doc;;
esac

43 changes: 13 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
sudo: required
dist: xenial
language: cpp
cache:
ccache: true
addons:
apt:
sources:
- sourceline: 'ppa:v-launchpad-jochen-sprickerhof-de/pcl'
packages:
- cmake
- libboost-filesystem1.54-dev
- libboost-iostreams1.54-dev
- libboost-thread1.54-dev
- libboost-chrono1.54-dev
- libboost-filesystem-dev
- libboost-iostreams-dev
- libboost-thread-dev
- libboost-chrono-dev
- libeigen3-dev
- libgtest-dev
- doxygen-latex
- dvipng
- libusb-1.0-0-dev
- libqhull-dev
- libvtk5-dev
- libvtk6-dev
- libvtk6-qt-dev
- libflann-dev
- doxygen
- libqt4-dev
- libqt4-opengl-dev
- libvtk5-qt4-dev
- qtbase5-dev
- libqt5opengl5-dev
- libglew-dev
- libopenni-dev
- python3-pip
- libproj-dev #missing dependency from vtk?
before_install:
- bash .travis.sh before-install

Expand Down Expand Up @@ -58,29 +58,12 @@ env:

jobs:
include:
- stage: Core Build
env: TASK="build"
compiler: gcc
script: bash .travis.sh $TASK
- env: TASK="build"
compiler: clang
script: bash .travis.sh $TASK
- stage: Extended Build and Tests
compiler: clang
env: TASK="build-examples"
script: bash .travis.sh $TASK
- compiler: clang
env: TASK="build-tools"
script: bash .travis.sh $TASK
- compiler: clang
env: TASK="build-apps"
script: bash .travis.sh $TASK
- compiler: gcc
env: TASK="doc"
script: bash .travis.sh $TASK
- compiler: gcc
env: TASK="test-core"
- compiler: clang
env: TASK="build"
script: bash .travis.sh $TASK
- compiler: gcc
env: TASK="test-ext"
env: TASK="test"
script: bash .travis.sh $TASK

0 comments on commit cb007cb

Please sign in to comment.