.travis.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # This .travis.yml is modified from the sample at
  2. # https://docs.haskellstack.org/en/stable/GUIDE/#travis-with-caching
  3. # Use new container infrastructure to enable caching
  4. sudo: false
  5. # Do not choose a language; we provide our own build tools.
  6. language: generic
  7. # Caching so the next build will be fast too.
  8. cache:
  9. directories:
  10. - $HOME/.ghc
  11. - $HOME/.cabal
  12. - $HOME/.stack
  13. # The different configurations we want to test. We have BUILD=cabal which uses
  14. # cabal-install, and BUILD=stack which uses Stack. More documentation on each
  15. # of those below.
  16. #
  17. # We set the compiler values here to tell Travis to use a different
  18. # cache file per set of arguments.
  19. #
  20. # If you need to have different apt packages for each combination in the
  21. # matrix, you can use a line such as:
  22. # addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
  23. matrix:
  24. include:
  25. # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
  26. # https://github.com/hvr/multi-ghc-travis
  27. - env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24
  28. compiler: ": #GHC 8.0.2"
  29. addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
  30. - env: BUILD=cabal GHCVER=8.4.3 CABALVER=2.2
  31. compiler: ": #GHC 8.4.3"
  32. addons: {apt: {packages: [cabal-install-2.2,ghc-8.4.3], sources: [hvr-ghc]}}
  33. # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
  34. # variable, such as using --stack-yaml to point to a different file.
  35. - env: BUILD=stack ARGS="--resolver lts-12"
  36. compiler: ": #stack 8.4.3"
  37. addons: {apt: {packages: [ghc-8.4.3], sources: [hvr-ghc]}}
  38. # Nightly builds are allowed to fail
  39. - env: BUILD=stack ARGS="--resolver nightly"
  40. compiler: ": #stack nightly"
  41. addons: {apt: {packages: [libgmp-dev]}}
  42. # - env: BUILD=stack ARGS="--resolver lts-8"
  43. # compiler: ": #stack 8.0.1 osx"
  44. # os: osx
  45. # - env: BUILD=stack ARGS="--resolver nightly"
  46. # compiler: ": #stack nightly osx"
  47. # os: osx
  48. allow_failures:
  49. - env: BUILD=cabal GHCVER=head CABALVER=head
  50. - env: BUILD=stack ARGS="--resolver nightly"
  51. fast_finish: true
  52. before_install:
  53. # Using compiler above sets CC to an invalid value, so unset it
  54. - unset CC
  55. # We want to always allow newer versions of packages when building on GHC HEAD
  56. - CABALARGS=""
  57. - if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
  58. # Download and unpack the stack executable
  59. - export PATH=$PATH:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin
  60. - mkdir -p ~/.local/bin
  61. - |
  62. if [ `uname` = "Darwin" ]
  63. then
  64. curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
  65. else
  66. curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
  67. fi
  68. install:
  69. - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
  70. - if [ -f configure.ac ]; then autoreconf -i; fi
  71. - |
  72. case "$BUILD" in
  73. stack)
  74. ulimit -n 4096
  75. stack --no-terminal --install-ghc $ARGS install
  76. ;;
  77. cabal)
  78. cabal --version
  79. travis_retry cabal update
  80. cabal install -j alex happy
  81. cabal install -j --only-dependencies -ffast --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS
  82. ;;
  83. esac
  84. script:
  85. - |
  86. case "$BUILD" in
  87. stack)
  88. ulimit -n 4096
  89. stack --no-terminal $ARGS install
  90. ;;
  91. cabal)
  92. cabal configure -fplugins -v2 -ffast --ghc-options="-O0 -Wall -fno-warn-unused-do-bind -Werror"
  93. cabal build -j
  94. cabal check
  95. cabal copy
  96. cabal sdist
  97. SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz && \
  98. (cd dist && cabal install -j --force-reinstalls "$SRC_TGZ")
  99. ;;
  100. esac