From 13ac8218b034caeb6f07c63437f27ca2c5629aa5 Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Mon, 30 Sep 2019 18:29:46 +0200 Subject: [PATCH] Travis: build carl-parser as dependency --- travis/build-helper.sh | 26 +++++++++++++++++++++++--- travis/build.sh | 15 ++++++++++++++- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/travis/build-helper.sh b/travis/build-helper.sh index 328140b..f6a9e41 100755 --- a/travis/build-helper.sh +++ b/travis/build-helper.sh @@ -11,11 +11,25 @@ travis_fold() { # Helper for building and testing run() { + + # Build carl-parser + travis_fold start build_carl_parser + git clone --single-branch -b master14 https://github.com/ths-rwth/carl-parser + cd carl-parser + mkdir build + cd build + cmake .. "${CMAKE_ARGS[@]}" + make carl-parser -j 1 + cd ../.. + travis_fold end build_carl_parser + # Create virtual environment + travis_fold start virtualenv virtualenv --python=$PYTHON stormpy-env source stormpy-env/bin/activate # Print version python --version + travis_fold end virtualenv # Build pycarl travis_fold start build_pycarl @@ -29,8 +43,8 @@ run() { python setup.py build_ext -j 1 develop ;; esac - travis_fold end build_pycarl cd .. + travis_fold end build_pycarl # Build stormpy travis_fold start build_stormpy @@ -46,13 +60,13 @@ run() { # Perform task case $TASK in - Test) + Test*) # Run tests set +e python setup.py test ;; - Documentation) + Documentation*) # Generate documentation pip install sphinx sphinx_bootstrap_theme cd doc @@ -72,4 +86,10 @@ run() { # ignored). export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" +case "$CONFIG" in +Debug*) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG") ;; +Release*) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG") ;; +*) echo "Unrecognized value of CONFIG: $CONFIG"; exit 1 ;; +esac + run diff --git a/travis/build.sh b/travis/build.sh index 2bbe2e8..f277324 100755 --- a/travis/build.sh +++ b/travis/build.sh @@ -1,5 +1,12 @@ #!/bin/bash -x +# Helper for travis folding +travis_fold() { + local action=$1 + local name=$2 + echo -en "travis_fold:${action}:${name}\r" +} + N_JOBS=2 OS=$TRAVIS_OS_NAME @@ -15,15 +22,21 @@ linux) # Copy local content into container docker exec stormpy mkdir /opt/stormpy docker cp . stormpy:/opt/stormpy - # Install virtualenv + + travis_fold start install_dependencies docker exec stormpy apt-get update + # Install dependencies for carl-parser + docker exec stormpy apt-get install -qq -y maven uuid-dev + # Install virtualenv docker exec stormpy apt-get install -qq -y python python3 virtualenv + travis_fold end install_dependencies set +e # Execute main process docker exec stormpy bash -c " export N_JOBS=$N_JOBS; export OS=$OS; + export STLARG=; export PYTHON=$PYTHON; export CONFIG=$CONFIG; export TASK=$TASK;