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.

95 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 task
  54. case $TASK in
  55. Test*)
  56. # Run tests
  57. set +e
  58. python setup.py test
  59. ;;
  60. Documentation*)
  61. # Generate documentation
  62. pip install sphinx sphinx_bootstrap_theme
  63. cd doc
  64. make html
  65. touch build/html/.nojekyll
  66. rm -r build/html/_sources
  67. ;;
  68. *)
  69. echo "Unrecognized value of TASK: $TASK"
  70. exit 1
  71. esac
  72. }
  73. # This only exists in OS X, but it doesn't cause issues in Linux (the dir doesn't exist, so it's
  74. # ignored).
  75. export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
  76. case "$CONFIG" in
  77. Debug*) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="$STLARG") ;;
  78. Release*) CMAKE_ARGS=(-DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="$STLARG") ;;
  79. *) echo "Unrecognized value of CONFIG: $CONFIG"; exit 1 ;;
  80. esac
  81. run