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.

94 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. # We start in /opt/stormpy
  12. cd ..
  13. # Build carl-parser
  14. travis_fold start build_carl_parser
  15. git clone --single-branch -b master14 https://github.com/ths-rwth/carl-parser
  16. cd carl-parser
  17. mkdir build
  18. cd build
  19. cmake .. "${CMAKE_ARGS[@]}"
  20. make carl-parser -j 1
  21. cd ../..
  22. travis_fold end build_carl_parser
  23. # Create virtual environment
  24. travis_fold start virtualenv
  25. virtualenv --python=$PYTHON venv
  26. source venv/bin/activate
  27. # Print version
  28. python --version
  29. travis_fold end virtualenv
  30. # Build pycarl
  31. travis_fold start build_pycarl
  32. git clone https://github.com/moves-rwth/pycarl.git
  33. cd pycarl
  34. case "$CONFIG" in
  35. Debug*)
  36. python setup.py build_ext --debug -j 1 develop
  37. ;;
  38. *)
  39. python setup.py build_ext -j 1 develop
  40. ;;
  41. esac
  42. cd ..
  43. travis_fold end build_pycarl
  44. # Build stormpy
  45. travis_fold start build_stormpy
  46. cd stormpy
  47. case "$CONFIG" in
  48. Debug*)
  49. python setup.py build_ext --storm-dir /opt/storm/build/ --debug -j 1 develop
  50. ;;
  51. *)
  52. python setup.py build_ext --storm-dir /opt/storm/build/ -j 1 develop
  53. ;;
  54. esac
  55. travis_fold end build_stormpy
  56. # Perform tasks
  57. if [[ "$TASK" == *Test* ]]
  58. then
  59. # Run tests
  60. set +e
  61. python setup.py test
  62. fi
  63. if [[ "$TASK" == *Documentation* ]]
  64. then
  65. # Generate documentation
  66. pip install sphinx sphinx_bootstrap_theme
  67. cd doc
  68. make html
  69. touch build/html/.nojekyll
  70. rm -r build/html/_sources
  71. fi
  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