Newer
Older
dub_jkp / travis-ci.sh
  1. #!/bin/bash
  2.  
  3. set -v -e -o pipefail
  4.  
  5. source ~/dlang/*/activate # activate host compiler
  6.  
  7. if [ -z "$FRONTEND" -o "$FRONTEND" \> 2.072.z ]; then
  8. vibe_ver=$(jq -r '.versions | .["vibe-d"]' < dub.selections.json)
  9. dub fetch vibe-d --version=$vibe_ver # get optional dependency
  10. dub test --compiler=${DC} -c library-nonet
  11. fi
  12.  
  13. if [ "$COVERAGE" = true ]; then
  14. # library-nonet fails to build with coverage (Issue 13742)
  15. dub test --compiler=${DC} -b unittest-cov
  16. ./build.sh -cov
  17.  
  18. # run tests with different compilers
  19. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  20. deactivate
  21. git clean -dxf -- test
  22. export FRONTEND=2.077
  23. source $(~/dlang/install.sh ldc-1.7.0 --activate)
  24. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  25. deactivate
  26. git clean -dxf -- test
  27. export FRONTEND=2.068
  28. source $(~/dlang/install.sh gdc-4.8.5 --activate)
  29. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  30. deactivate
  31. else
  32. ./build.sh
  33. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  34. fi
  35.  
  36. if [ "$COVERAGE" = true ]; then
  37. wget https://codecov.io/bash -O codecov.sh
  38. bash codecov.sh
  39. fi
  40.  
  41. # check for trailing whitespace (needs to be done only once per build)
  42. if [ "$COVERAGE" = true ]; then
  43. find . -type f -name '*.d' -exec grep -Hn "[[:blank:]]$" {} \;
  44. fi
  45.  
  46. # check that the man page generation still works (only once)
  47. if [ "$COVERAGE" = true ]; then
  48. source $(~/dlang/install.sh dmd --activate)
  49. dub --single -v scripts/man/gen_man.d
  50. fi