Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing documentation checks and updating Travis build #1335

Merged
merged 23 commits into from
Jul 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
17c34f8
Fix doxygen.log path
rolanddenis Jul 11, 2018
7ad2773
Temporaly disabling build to speed up tests for the current PR
rolanddenis Jul 11, 2018
86689fc
Refactoring travis config
rolanddenis Jul 11, 2018
ea5c178
Fixing Travis and missing build script
rolanddenis Jul 11, 2018
db39ccc
More fix
rolanddenis Jul 11, 2018
1d7c398
Travis configure fix
rolanddenis Jul 11, 2018
3acb5ad
Fixing travis again
rolanddenis Jul 11, 2018
6484174
Fixing DGtalTools tagfile download location
rolanddenis Jul 11, 2018
516dfcb
Creating build dir earlier in the Travis process
rolanddenis Jul 11, 2018
3b8f170
Fixing path in Eigen installing for Travis
rolanddenis Jul 11, 2018
5cb905b
Fixing doxygen warnings
rolanddenis Jul 11, 2018
41a0c69
Try to find the bug with install_eigen under MacOs
rolanddenis Jul 12, 2018
eb92f93
Reducing concurrent job while building in Travis
rolanddenis Jul 12, 2018
9dd4fe0
Uniform begin and end of the scripts used in Travis
rolanddenis Jul 12, 2018
b7b2019
Disabling -e option for brew install
rolanddenis Jul 12, 2018
046b565
Codacy suggestion
rolanddenis Jul 12, 2018
4a7b356
Removing old Travis script
rolanddenis Jul 12, 2018
61a32dc
Disabling verbose mode of Travis
rolanddenis Jul 12, 2018
fbbae93
Matching checked extensions with Doxygen configuration
rolanddenis Jul 12, 2018
4dc672c
Updating ChangeLog.md
rolanddenis Jul 12, 2018
2824acf
Fixing online documentation publication
rolanddenis Jul 12, 2018
5d8b0c7
Adding shebang in getAndCheckDGtalTools script
rolanddenis Jul 12, 2018
9e17147
Fixing single/double quotes in public_doc.sh
rolanddenis Jul 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 22 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,40 +69,45 @@ addons:
- g++-5

before_install:
- export DEC="false";
- source .travis/before_global.sh
- echo "C++ ===> $CXXCOMPILER"
- if [ $CONFIG == "Debug,Cairo,QGLviewer,HDF5,EIGEN" ]; then source .travis/install_eigen.sh ; cd $TRAVIS_BUILD_DIR; fi
- if [ $CONFIG == "Debug,Cairo,QGLviewer,HDF5,EIGEN" ]; then source "$SRC_DIR/.travis/install_eigen.sh" ; fi
- echo $EIGEN_ROOT
- if [ $CONFIG == "Documentation" ]; then export NEEDEXAMPLESANDTESTS="false"; export NEEDCORE="false"; export BUILD_DOC="true"; if [ $OriginalRepo == "true" ]; then if [ $TRAVIS_PULL_REQUEST == "false" ]; then export UPLOAD_DOC="true"; fi; fi; fi
- if [ $CONFIG == "Debug,Magick,GMP,ITK,FFTW3" ]; then export BTYPE="-DCMAKE_BUILD_TYPE=Debug -DWITH_MAGICK=true -DWITH_GMP=true -DWITH_FFTW3=true -DBUILD_TESTING=ON -DWARNING_AS_ERROR=ON"; fi
- if [ $CONFIG == "Debug,Cairo,QGLviewer,HDF5,EIGEN" ]; then export DEC="true"; export BTYPE="-DCMAKE_BUILD_TYPE=Debug -DWITH_HDF5=true -DWITH_CAIRO=true -DWITH_QGLVIEWER=true -DBUILD_TESTING=ON -DWITH_EIGEN=true -DWARNING_AS_ERROR=OFF -DEIGEN3_INCLUDE_DIR='$EIGEN_ROOT/include/eigen3'"; fi
- if [ $CONFIG == "DGtalTools" ]; then export NEEDEXAMPLESANDTESTS="false"; export BTYPE="-DCMAKE_BUILD_TYPE=Debug -DWITH_MAGICK=true -DWITH_GMP=true -DWITH_HDF5=true -DWITH_CAIRO=true -DWITH_QGLVIEWER=true -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=off"; fi
- if [ $UPLOAD_DOC == "true" ]; then openssl aes-256-cbc -K $encrypted_47769ec71275_key -iv $encrypted_47769ec71275_iv -in .travis/dgtal_rsa.enc -out .travis/dgtal_rsa -d; chmod 600 .travis/dgtal_rsa; BUILD_DOC="true"; fi
- if [ $BUILD_DOC == "true" ]; then wget --no-check-certificate http://dgtal.org/doc/tags/DGtalTools-tagfile; fi
- if [ $BUILD_DOC == "true" ]; then .travis/install_doxygen.sh; export BTYPE="-DDOXYGEN_EXECUTABLE=$HOME/doxygen/doxygen-1.8.10/bin/doxygen"; fi
- if [ $CONFIG == "Documentation" ]; then export BUILD_DOC="true"; if [ $OriginalRepo == "true" ] && [ $TRAVIS_PULL_REQUEST == "false" ]; then export UPLOAD_DOC="true"; fi; fi
- if [ $CONFIG == "Debug,Magick,GMP,ITK,FFTW3" ]; then export BUILD_ALL="true"; export BTYPE="$BTYPE -DCMAKE_BUILD_TYPE=Debug -DWITH_MAGICK=true -DWITH_GMP=true -DWITH_FFTW3=true -DWARNING_AS_ERROR=ON"; fi
- if [ $CONFIG == "Debug,Cairo,QGLviewer,HDF5,EIGEN" ]; then export BUILD_ALL="true"; export BUILD_DEC="true"; export BTYPE="$BTYPE -DCMAKE_BUILD_TYPE=Debug -DWITH_HDF5=true -DWITH_CAIRO=true -DWITH_QGLVIEWER=true -DWITH_EIGEN=true -DWARNING_AS_ERROR=OFF -DEIGEN3_INCLUDE_DIR='$EIGEN_ROOT/include/eigen3'"; fi
- if [ $CONFIG == "DGtalTools" ]; then export BUILD_DGTAL="true"; export BTYPE="$BTYPE -DCMAKE_BUILD_TYPE=Debug -DWITH_MAGICK=true -DWITH_GMP=true -DWITH_HDF5=true -DWITH_CAIRO=true -DWITH_QGLVIEWER=true"; fi
- if [ $UPLOAD_DOC == "true" ]; then openssl aes-256-cbc -K $encrypted_47769ec71275_key -iv $encrypted_47769ec71275_iv -in "$SRC_DIR/.travis/dgtal_rsa.enc" -out "$SRC_DIR/.travis/dgtal_rsa" -d; chmod 600 "$SRC_DIR/.travis/dgtal_rsa"; fi
- if [ $BUILD_DOC == "true" ]; then wget --no-check-certificate -O "$BUILD_DIR/DGtalTools-tagfile" http://dgtal.org/doc/tags/DGtalTools-tagfile; fi
- if [ $BUILD_DOC == "true" ]; then "$SRC_DIR/.travis/install_doxygen.sh"; export BTYPE="-DDOXYGEN_EXECUTABLE=$HOME/doxygen/doxygen-1.8.10/bin/doxygen"; fi


########
# Deps.
########
before_script:
- if [ $TRAVIS_OS_NAME == linux ]; then echo "All done."; fi
- if [ $TRAVIS_OS_NAME == osx ]; then source .travis/install_deps_macos.sh; fi

- if [ $TRAVIS_OS_NAME == linux ]; then echo "All done."; fi
- if [ $TRAVIS_OS_NAME == osx ]; then source "$SRC_DIR/.travis/install_deps_macos.sh"; fi
- source "$SRC_DIR/.travis/fix_step_dependencies.sh"

############
# Main rules
############
script:
- echo "---- $BTYPE ---$BUILD_DOC---$UPLOAD_DOC"
- .travis/main_build.sh
- if [ $CONFIG == "DGtalTools" ]; then .travis/getAndCheckDGtalTools.sh ; fi
- if [ $CONFIG == "Documentation" ]; then .travis/checkDoxygenDocumentation.sh; fi
- "$SRC_DIR/.travis/configure_build.sh"
- if [ $BUILD_DGTAL == "true" ]; then "$SRC_DIR/.travis/build_dgtal.sh"; fi
- if [ $BUILD_DEC == "true" ]; then "$SRC_DIR/.travis/build_dec.sh"; fi
- if [ $BUILD_EXAMPLES == "true" ]; then "$SRC_DIR/.travis/build_examples.sh"; fi
- if [ $BUILD_TESTS == "true" ]; then "$SRC_DIR/.travis/build_tests.sh"; fi
- if [ $BUILD_TESTS == "true" ]; then "$SRC_DIR/.travis/check_tests.sh"; fi
- if [ $BUILD_DGTAL == "true" ]; then "$SRC_DIR/.travis/build_all.sh"; fi
- if [ $CONFIG == "DGtalTools" ]; then "$SRC_DIR/.travis/getAndCheckDGtalTools.sh" ; fi
- if [ $BUILD_DOC == "true" ]; then "$SRC_DIR/.travis/build_doc.sh"; fi
- if [ $BUILD_DOC == "true" ]; then "$SRC_DIR/.travis/checkDoxygenDocumentation.sh"; fi


###########
## Building the documentation
###########
after_success:
- if [ $UPLOAD_DOC == "true" ]; then echo "Uploading the doc..."; .travis/publish_doc.sh; fi
- if [ $UPLOAD_DOC == "true" ]; then echo "Uploading the doc..."; "$SRC_DIR/.travis/publish_doc.sh"; fi
52 changes: 43 additions & 9 deletions .travis/before_global.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,54 @@
#!/bin/bash

# Useful paths
export SRC_DIR="$TRAVIS_BUILD_DIR"
export BUILD_DIR="$SRC_DIR/build"

# Options send to the set command.
# e to exit immediately if a command fails
# v to print each input lines as they are read (useful for debugging)
export SET_OPTIONS=e

# Commands at script begin and end
export SCRIPT_BEGIN="set -$SET_OPTIONS"
export SCRIPT_END="set +$SET_OPTIONS ; cd \"$SRC_DIR\""

# Debug
echo $SCRIPT_BEGIN
echo $SCRIPT_END

$SCRIPT_BEGIN

# Main steps configuration
export BUILD_DOC="false"
export UPLOAD_DOC="false"
export NEEDCORE="true"
export BUILD_DGTAL="false"
export BUILD_EXAMPLES="false"
export BUILD_TESTS="false"
export BUILD_DEC="false"
export BUILD_ALL="false" # Build DGtal, examples and tests

export NEEDEXAMPLESANDTESTS="true";
export SRC_DIR="`pwd`"
# Build default options
export BTYPE=
export BJOBS=2 # See https://docs.travis-ci.com/user/reference/overview/#Virtualisation-Environment-vs-Operating-System

export CCOMPILER = $CC
export CXXCOMPILER = $CXX
if [ $CC == "gcc" ]; then export CCOMPILER=gcc-5 ; export CXXCOMPILER=g++-5; fi
# Compiler configuration
export CCOMPILER=$CC
export CXXCOMPILER=$CXX
if [ "$CC" == "gcc" ]
then
export CCOMPILER=gcc-5
export CXXCOMPILER=g++-5
fi

# Build directory
mkdir -p "$BUILD_DIR"

export MAGICK_CONFIG_PATH=".travis/delegate.mgk"
$MAGICK_CODER_MODULE_PATH
$MAGICK_FILTER_MODULE_PATH
##Preparing folders
mkdir deps/
mkdir deps/local

# Preparing folders
mkdir -p "$SRC_DIR/deps/local"

$SCRIPT_END
8 changes: 8 additions & 0 deletions .travis/build_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
$SCRIPT_BEGIN

### DGtal build
cd "$BUILD_DIR"
make -j $BJOBS

$SCRIPT_END
14 changes: 14 additions & 0 deletions .travis/build_dec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
$SCRIPT_BEGIN

### Dec
echo "Compile Dec in non parallel mode to save memory (to fix gcc internal compiler error(Killed))";

cd "$BUILD_DIR"
make exampleDiscreteExteriorCalculusChladni
#make exampleDiscreteExteriorCalculusSolve
#make exampleDECSurface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why these one have been commented ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a copy-paste from .travis/main_build.sh:

#make exampleDiscreteExteriorCalculusSolve;

and it has been commented in 163a835 from #1306 but I don't know why (@kerautret ?).

I will try to uncomment these lines :octocat:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was to try to avoid the segfault or timeout issue of travis due to gcc problem (as discussed with Jaco in last meeting). Changing the moment where it was compiled fixed the memory issue (I suppose), but perhaps we have to remove this example from the travis test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, these two examples are already built during the main build. This part is only for examples that need to be build alone in order to avoid compiler failures. I think we can remove these two lines ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups, didn't see your answer 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes of course if they are in the main part, but it was commented because it was an alternative.
But this part is not robust in all cases.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering ;)

make examplePropagation
make testDiscreteExteriorCalculusExtended

$SCRIPT_END
8 changes: 8 additions & 0 deletions .travis/build_dgtal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
$SCRIPT_BEGIN

### DGtal build
cd "$BUILD_DIR"
make -j $BJOBS DGtal

$SCRIPT_END
8 changes: 8 additions & 0 deletions .travis/build_doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
$SCRIPT_BEGIN

### DGtal Doc
cd "$BUILD_DIR"
make doc > buildDoc.log

$SCRIPT_END
8 changes: 8 additions & 0 deletions .travis/build_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
$SCRIPT_BEGIN

### DGtal Examples
cd "$BUILD_DIR/examples"
make -j $BJOBS

$SCRIPT_END
8 changes: 8 additions & 0 deletions .travis/build_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
$SCRIPT_BEGIN

### DGtal Tests
cd "$BUILD_DIR/tests"
make -j $BJOBS

$SCRIPT_END
40 changes: 25 additions & 15 deletions .travis/checkDoxygenDocumentation.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
#!/bin/bash
$SCRIPT_BEGIN

return_code=0
return_code2=0
return_code3=0
HOMEPATH=$PWD

DOXYGENLOG=${BUILD_DIR}/doxygen.log

## We first check that the doxygen.log is empty
if [[ -s doxygen.log ]]
if [[ -f "$DOXYGENLOG" ]]
then
return_code=1
echo "Doxygen log file not empty !"
echo "====================================="
cat doxygen.log
echo "====================================="
if [[ -s "$DOXYGENLOG" ]]
then
return_code=1
echo "Doxygen log file not empty !"
echo "====================================="
cat "$DOXYGENLOG"
echo "====================================="
else
echo "Doxygen log OK"
return_code=0
fi
else
return_code=0
return_code=1
echo "Doxygen log file not found !"
fi


## We check src code consitency
cd src/
$HOMEPATH/.travis/check_src_file_tag.sh
if [[ $? -ne 0 ]]
cd "$SRC_DIR/src"
"$SRC_DIR/.travis/check_src_file_tag.sh"
if [[ $? == 0 ]]
then
return_code2=1;
echo "@file tag OK"
else
return_code=1;
fi
cd ..

Expand All @@ -32,5 +41,6 @@ cd ..
# TODO
#

return_code=$((return_code + return_code2 + return_code3))
$SCRIPT_END

exit $return_code
3 changes: 3 additions & 0 deletions .travis/check_examples_file_tag.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
$SCRIPT_BEGIN

return_code=0

Expand All @@ -17,4 +18,6 @@ do
fi
done

$SCRIPT_END

exit $return_code
5 changes: 4 additions & 1 deletion .travis/check_src_file_tag.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
$SCRIPT_BEGIN

return_code=0

# Checking that source code has proper @file tag
for file in `find * -type f \( -name \*.cpp -o -name \*.h -o -name \*.ih \)`
for file in $(find * -type f \( -name \*.cpp -o -name \*.h -o -name \*.ih \))
do
expected_name=$(basename $file)
if ! $(grep -aqE "^\s*(\**|//[/!]|/\*[\*!])\s*?[@\\\\]file(\s+${expected_name})?\s*$" $file)
Expand All @@ -18,4 +19,6 @@ do
fi
done

$SCRIPT_END

exit $return_code
17 changes: 17 additions & 0 deletions .travis/check_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
$SCRIPT_BEGIN

### DGtal Tests
cd "$BUILD_DIR/tests"

if [ -f io/writers/testMagickWriter ]; then
io/writers/testMagickWriter -s
fi

if [ -f io/readers/testMagickReader ]; then
io/readers/testMagickReader
fi

ctest -j $BJOBS --output-on-failure

$SCRIPT_END
15 changes: 15 additions & 0 deletions .travis/configure_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
$SCRIPT_BEGIN

# Build directory
cd "$BUILD_DIR"

# Common build options
export BTYPE="$BTYPE -DBUILD_TESTING=$BUILD_TESTS -DBUILD_EXAMPLES=$BUILD_EXAMPLES -DCMAKE_CXX_COMPILER=$CXXCOMPILER -DCMAKE_C_COMPILER=$CCOMPILER"

# Cmake
echo "Using C++ = $CXXCOMPILER"
echo "CMake options = $BTYPE"
cmake "$SRC_DIR" $BTYPE

$SCRIPT_END
27 changes: 27 additions & 0 deletions .travis/fix_step_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
$SCRIPT_BEGIN

if [[ "$BUILD_DEC" == "true" ]]
then
export BUILD_TESTS="true"
export BUILD_EXAMPLES="true"
fi

if [[ "$BUILD_ALL" == "true" ]]
then
export BUILD_TESTS="true"
export BUILD_EXAMPLES="true"
export BUILD_DGTAL="true"
fi

if [[ "$BUILD_TESTS" == "true" ]] || [[ "$BUILD_EXAMPLES" == "true" ]]
then
export BUILD_DGTAL="true"
fi

if [[ "$UPLOAD_DOC" == "true" ]]
then
export BUILD_DOC="true"
fi

$SCRIPT_END
11 changes: 8 additions & 3 deletions .travis/getAndCheckDGtalTools.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/bin/bash
$SCRIPT_BEGIN

## Get and test if DGtalTools compiles
DGTALPATH=`pwd`
DGTALPATH="$SRC_DIR"
echo "DGtal path = $DGTALPATH"
git clone --depth 1 git://github.com/DGtal-team/DGtalTools.git
cd DGtalTools
mkdir build ; cd build
cmake .. -DDGtal_DIR=$DGTALPATH/build $BUILD
make -j 2
cmake .. -DDGtal_DIR="$BUILD_DIR" $BUILD
make -j $BJOBS

$SCRIPT_END
5 changes: 5 additions & 0 deletions .travis/install_deps_macos.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
$SCRIPT_BEGIN

set +e # The brew install has errors

#
# Note: gmp and boost already installed
Expand All @@ -12,3 +15,5 @@ brew install http://liris.cnrs.fr/david.coeurjolly/misc/libqglviewer.rb
## Temporary HDF5 build issue
export BTYPE="$BTYPE -DWITH_HDF5=false" && echo "Disabling HDF5 on MacOS";
export BTYPE="$BTYPE -DWITH_QT5=true -DCMAKE_PREFIX_PATH=$(brew --prefix qt5)" && echo "Forcing Qt5 on MacOS";

$SCRIPT_END
3 changes: 3 additions & 0 deletions .travis/install_doxygen.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash
$SCRIPT_BEGIN

#
##Download and install 1.8.1
#

mkdir ~/doxygen && cd ~/doxygen
wget http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.10.linux.bin.tar.gz && tar xzf doxygen-1.8.10.linux.bin.tar.gz

$SCRIPT_END
Loading