aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/travis_build
blob: 9d431e3918bf3862d0ef7e1c187555e9f1686a1d (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
#!/usr/bin/env bash

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

# go to correct directory
cd $TRAVIS_BUILD_DIR

# start building
mkdir -p build
cd build
cmake ..
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