aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/travis_build
blob: 3cca70a26d19bed7ecac200978953ad8f10a98f0 (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
#!/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
cd ../..

# update docs if we are on the master branch
if [[ "$TRAVIS_BRANCH" == "master" ]]; then
    if [ -d "$TRAVIS_BUILD_DIR/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 "Rebuilding documentation"
        git push -q origin gh-pages
        cd ..
    fi
fi