aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/travis_build
blob: 1efb93645a9f890f7b37c70ab2ce395e16abc385 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash

set -eu

# check compiler versions
$CC --version
$CXX --version

# go to correct directory
cd $TRAVIS_BUILD_DIR

# start building
mkdir -p build
cd build
cmake -DYAGE_BUILD_TESTS=ON -DYAGE_BUILD_DOCS=ON -DYAGE_BUILD_EXAMPLES=ON ..
make
cd tests
ctest -j 2 --schedule-random --repeat-until-fail 3
cd ../..

# update docs if we are on the master branch
echo "TRAVIS_BRANCH = " $TRAVIS_BRANCH
echo "BUILD_DOCS    = " $BUILD_DOCS
echo "CC            = " $CC
echo "CXX           = " $CXX

if [[ $TRAVIS_BRANCH = "master" && $BUILD_DOCS -eq 1 ]]; then
  if [[ -d "build/doc_doxygen/html" ]]; then
    git clone -b gh-pages "https://$GH_TOKEN@github.com/ymherklotz/YAGE.git" YAGE_gh-pages
    cd YAGE_gh-pages
    git config user.name "TravisBot"
    git config user.email ""
    rm -rf *
    cp -r ../build/doc_doxygen/html/* .
    git add -A .
    git commit -m "[Travis] Rebuilding documentation"
    git push -q origin gh-pages
  fi
fi