Newer
Older
dub_jkp / semaphore-ci.sh
  1. #!/bin/bash
  2.  
  3. set -euo pipefail
  4. set -x
  5.  
  6. if [ "${D_VERSION:-dmd}" == "gdc" ] ; then
  7. echo "GDC unrelated test failures to be fixed"
  8. exit 0
  9.  
  10. # Use the dub-updating fork of the installer script until https://github.com/dlang/installer/pull/301 is merged
  11. wget https://raw.githubusercontent.com/wilzbach/installer-dub/master/script/install.sh -O install.dub.sh
  12. bash install.dub.sh -a dub
  13. dub_path_activate="$(find $HOME/dlang/*/activate | head -1)"
  14. rm "${dub_path_activate}"
  15. dub_path="$(dirname "$dub_path_activate")"
  16. sudo ln -s "${dub_path}/dub" /usr/bin/dub
  17.  
  18. export DMD=gdmd
  19. export DC=gdc
  20. # It's technically ~"2.076", but Ternary doesn't seem to have been ported and Vibe.d seems to depend on this.
  21. # Ternary was added in 2.072: https://dlang.org/phobos/std_typecons.html#.Ternary
  22. # However, the nonet tests is done only for > 2.072
  23. export FRONTEND=2.072
  24.  
  25. sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
  26. sudo apt-get update
  27. sudo apt-get install -y gdc-9
  28. # fetch the dmd-like wrapper
  29. sudo wget https://raw.githubusercontent.com/D-Programming-GDC/GDMD/master/dmd-script -O /usr/bin/gdmd
  30. sudo chmod +x /usr/bin/gdmd
  31. # DUB requires gdmd
  32. sudo ln -s /usr/bin/gdc-9 /usr/bin/gdc
  33. # fake install script and create a fake 'activate' script
  34. mkdir -p ~/dlang/gdc-9
  35. echo "deactivate(){ echo;}" > ~/dlang/gdc-9/activate
  36.  
  37. else
  38. . $(curl --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 1 --retry-max-time 60 https://dlang.org/install.sh | bash -s "$D_VERSION" -a)
  39. fi
  40.  
  41. ./scripts/ci/travis.sh