.travis.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. sudo: enabled
  2. language: generic
  3. addons:
  4. apt:
  5. packages:
  6. - libgmp-dev
  7. postgresql: "9.6"
  8. services:
  9. - mongodb
  10. - mysql
  11. - redis-server
  12. matrix:
  13. include:
  14. - env: BUILD=cabal GHCVER=8.2.2 CABALVER=2.0 HAPPYVER=1.19.5 ALEXVER=3.1.7
  15. compiler: ": #GHC 8.2.2"
  16. addons: {postgresql: "9.6", apt: {packages: [cabal-install-2.0,ghc-8.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
  17. - env: BUILD=cabal GHCVER=8.4.4 CABALVER=2.0 HAPPYVER=1.19.5 ALEXVER=3.1.7
  18. compiler: ": #GHC 8.4.4"
  19. addons: {postgresql: "9.6", apt: {packages: [cabal-install-2.0,ghc-8.4.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
  20. - env: BUILD=cabal GHCVER=8.6.4 CABALVER=2.0 HAPPYVER=1.19.5 ALEXVER=3.1.7
  21. compiler: ": #GHC 8.6.4"
  22. addons: {postgresql: "9.6", apt: {packages: [cabal-install-2.0,ghc-8.6.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
  23. # Build with the newest GHC and cabal-install. This is an accepted failure,
  24. # see below.
  25. - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
  26. compiler: ": #GHC HEAD"
  27. addons: {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
  28. - env: BUILD=stack ARGS="--resolver lts-9 --stack-yaml stack_lts-10.yaml"
  29. - env: BUILD=stack ARGS="--resolver lts-11 --stack-yaml stack_lts-12.yaml"
  30. - env: BUILD=stack ARGS="--resolver lts-12 --stack-yaml stack_lts-12.yaml"
  31. - env: BUILD=stack ARGS="--resolver lts-13"
  32. # Nightly builds are allowed to fail
  33. - env: BUILD=stack ARGS="--resolver nightly"
  34. compiler: ": #stack nightly"
  35. allow_failures:
  36. - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
  37. - env: BUILD=stack ARGS="--resolver nightly"
  38. before_install:
  39. # Using compiler above sets CC to an invalid value, so unset it
  40. - unset CC
  41. # We want to always allow newer versions of packages when building on GHC HEAD
  42. - CABALARGS=""
  43. - if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
  44. # Download and unpack the stack executable
  45. - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:/opt/alex/$ALEXVER/bin:/opt/happy/$HAPPYVER/bin:$HOME/.cabal/bin:$PATH
  46. - mkdir -p ~/.local/bin
  47. - |
  48. if [ `uname` = "Darwin" ]
  49. then
  50. travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
  51. else
  52. travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
  53. fi
  54. # Use the more reliable S3 mirror of Hackage
  55. mkdir -p $HOME/.cabal
  56. echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
  57. echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
  58. if [ "$CABALVER" != "1.16" ]
  59. then
  60. echo 'jobs: $ncpus' >> $HOME/.cabal/config
  61. fi
  62. install:
  63. - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
  64. - if [ -f configure.ac ]; then autoreconf -i; fi
  65. - |
  66. set -ex
  67. case "$BUILD" in
  68. stack)
  69. # Build the dependencies
  70. stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies
  71. ;;
  72. cabal)
  73. cabal --version
  74. travis_retry cabal update
  75. # travis_retry cabal update
  76. # Get the list of packages from the stack.yaml file. Note that
  77. # this will also implicitly run hpack as necessary to generate
  78. # the .cabal files needed by cabal-install.
  79. # PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
  80. # cabal new-build does not require the list of packages because it is
  81. # specified in the cabal.project file
  82. cabal new-build all --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS
  83. ;;
  84. esac
  85. set +ex
  86. script: travis/run.sh
  87. cache:
  88. directories:
  89. - $HOME/.stack
  90. - $HOME/.ghc
  91. - $HOME/.cabal