Newer
Older
dub_jkp / scripts / ci / travis.sh
  1. #!/bin/bash
  2.  
  3. set -v -e -o pipefail
  4.  
  5. vibe_ver=$(jq -r '.versions | .["vibe-d"]' < dub.selections.json)
  6. dub fetch vibe-d --version=$vibe_ver # get optional dependency
  7. dub test --compiler=${DC} -c library-nonet
  8.  
  9. export DMD="$(command -v $DMD)"
  10.  
  11. if [ "$FRONTEND" \> 2.087.z ]; then
  12. ./build.d -preview=dip1000 -w -g -debug
  13. fi
  14.  
  15. function clean() {
  16. # Hard reset of the DUB local folder is necessary as some tests
  17. # currently don't properly clean themselves
  18. rm -rf ~/.dub
  19. git clean -dxf -- test
  20. }
  21.  
  22. if [ "$COVERAGE" = true ]; then
  23. # library-nonet fails to build with coverage (Issue 13742)
  24. dub test --compiler=${DC} -b unittest-cov
  25. ./build.d -cov
  26.  
  27. wget https://codecov.io/bash -O codecov.sh
  28. bash codecov.sh
  29. else
  30. ./build.d
  31. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  32. fi
  33.  
  34. ## Checks that only need to be done once per CI run
  35. ## Here the `COVERAGE` variable is abused for this purpose,
  36. ## as it's only defined once in the whole Travis matrix
  37. if [ "$COVERAGE" = true ]; then
  38. # run tests with different compilers
  39. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  40. clean
  41.  
  42. export FRONTEND=2.077
  43. source $(~/dlang/install.sh ldc-1.7.0 --activate)
  44. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  45. deactivate
  46. clean
  47.  
  48. export FRONTEND=2.068
  49. source $(~/dlang/install.sh gdc-4.8.5 --activate)
  50. DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
  51. deactivate
  52.  
  53. # check for trailing whitespace
  54. find . -type f -name '*.d' -exec grep -Hn "[[:blank:]]$" {} \;
  55. # check that the man page generation still works
  56. source $(~/dlang/install.sh dmd --activate)
  57. source $(~/dlang/install.sh dub --activate)
  58. dub --single -v scripts/man/gen_man.d
  59. fi