You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.0 KiB

  1. #!/bin/bash
  2. set -e
  3. # Helper for travis folding
  4. travis_fold() {
  5. local action=$1
  6. local name=$2
  7. echo -en "travis_fold:${action}:${name}\r"
  8. }
  9. # Helper for building and testing
  10. run() {
  11. # Build carl-parser
  12. travis_fold start build_carl_parser
  13. git clone --single-branch -b master14 https://github.com/ths-rwth/carl-parser
  14. cd carl-parser
  15. mkdir build
  16. cd build
  17. cmake .. "${CMAKE_ARGS[@]}"
  18. make carl-parser -j 1
  19. cd ../..
  20. travis_fold end build_carl_parser
  21. # Create virtual environment
  22. travis_fold start virtualenv
  23. virtualenv --python=$PYTHON stormpy-env
  24. source stormpy-env/bin/activate
  25. # Print version
  26. python --version
  27. travis_fold end virtualenv
  28. # Build pycarl
  29. travis_fold start build_pycarl
  30. git clone https://github.com/moves-rwth/pycarl.git
  31. cd pycarl
  32. case "$CONFIG" in
  33. Debug*)
  34. python setup.py build_ext --debug -j 1 develop
  35. ;;
  36. *)
  37. python setup.py build_ext -j 1 develop
  38. ;;
  39. esac
  40. cd ..
  41. travis_fold end build_pycarl
  42. # Build stormpy
  43. travis_fold start build_stormpy
  44. case "$CONFIG" in
  45. Debug*)
  46. python setup.py build_ext --storm-dir /opt/storm/build/ --debug -j 1 develop
  47. ;;
  48. *)
  49. python setup.py build_ext --storm-dir /opt/storm/build/ -j 1 develop
  50. ;;
  51. esac
  52. travis_fold end build_stormpy
  53. # Perform tasks
  54. if [[ "$TASK" == *Test* ]]
  55. then
  56. # Run tests
  57. set +e
  58. python setup.py test
  59. fi
  60. if [[ "$TASK" == *Documentation* ]]
  61. then
  62. # Generate documentation
  63. pip install sphinx sphinx_bootstrap_theme
  64. cd doc
  65. make html
  66. touch build/html/.nojekyll
  67. rm -r build/html/_sources
  68. fi
  69. }
  70. # This only exists in OS X, but it doesn't cause issues in Linux (the dir doesn't exist, so it's
  71. # ignored).
  72. export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
  73. case "$CONFIG" in
  74. Debug*) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG") ;;
  75. Release*) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG") ;;
  76. *) echo "Unrecognized value of CONFIG: $CONFIG"; exit 1 ;;
  77. esac
  78. run