.travis.yml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. # This is the complex Travis configuration, which is intended for use
  2. # on open source libraries which need compatibility across multiple GHC
  3. # versions, must work with cabal-install, and should be
  4. # cross-platform. For more information and other options, see:
  5. #
  6. # https://docs.haskellstack.org/en/stable/travis_ci/
  7. #
  8. # Copy these contents into the root directory of your Github project in a file
  9. # named .travis.yml
  10. # Use new container infrastructure to enable caching
  11. sudo: false
  12. # Do not choose a language; we provide our own build tools.
  13. language: generic
  14. # Caching so the next build will be fast too.
  15. cache:
  16. directories:
  17. - $HOME/.ghc
  18. - $HOME/.cabal
  19. - $HOME/.stack
  20. # The different configurations we want to test. We have BUILD=cabal which uses
  21. # cabal-install, and BUILD=stack which uses Stack. More documentation on each
  22. # of those below.
  23. #
  24. # We set the compiler values here to tell Travis to use a different
  25. # cache file per set of arguments.
  26. #
  27. # If you need to have different apt packages for each combination in the
  28. # matrix, you can use a line such as:
  29. # addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}}
  30. matrix:
  31. include:
  32. # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See:
  33. # https://github.com/hvr/multi-ghc-travis
  34. #- env: BUILD=cabal GHCVER=7.0.4 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
  35. # compiler: ": #GHC 7.0.4"
  36. # addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
  37. #- env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
  38. # compiler: ": #GHC 7.2.2"
  39. # addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
  40. #- env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
  41. # compiler: ": #GHC 7.4.2"
  42. # addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
  43. #- env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7
  44. # compiler: ": #GHC 7.6.3"
  45. # addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
  46. - env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 HAPPYVER=1.19.5 ALEXVER=3.1.7
  47. compiler: ": #GHC 7.8.4"
  48. addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
  49. - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7
  50. compiler: ": #GHC 7.10.3"
  51. addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
  52. - env: BUILD=cabal GHCVER=8.0.2 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7
  53. compiler: ": #GHC 8.0.2"
  54. addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
  55. # Build with the newest GHC and cabal-install. This is an accepted failure,
  56. # see below.
  57. - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
  58. compiler: ": #GHC HEAD"
  59. addons: {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}}
  60. # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS
  61. # variable, such as using --stack-yaml to point to a different file.
  62. - env: BUILD=stack ARGS=""
  63. compiler: ": #stack default"
  64. addons: {apt: {packages: [libgmp-dev]}}
  65. - env: BUILD=stack ARGS="--resolver lts-2" STACK_YAML="stack-lts-2.yaml"
  66. compiler: ": #stack 7.8.4"
  67. addons: {apt: {packages: [libgmp-dev]}}
  68. - env: BUILD=stack ARGS="--resolver lts-3"
  69. compiler: ": #stack 7.10.2"
  70. addons: {apt: {packages: [libgmp-dev]}}
  71. - env: BUILD=stack ARGS="--resolver lts-6"
  72. compiler: ": #stack 7.10.3"
  73. addons: {apt: {packages: [libgmp-dev]}}
  74. - env: BUILD=stack ARGS="--resolver lts-7"
  75. compiler: ": #stack 8.0.1"
  76. addons: {apt: {packages: [libgmp-dev]}}
  77. - env: BUILD=stack ARGS="--resolver lts-8"
  78. compiler: ": #stack 8.0.2"
  79. addons: {apt: {packages: [libgmp-dev]}}
  80. # Nightly builds are allowed to fail
  81. - env: BUILD=stack ARGS="--resolver nightly"
  82. compiler: ": #stack nightly"
  83. addons: {apt: {packages: [libgmp-dev]}}
  84. # Build on macOS in addition to Linux
  85. - env: BUILD=stack ARGS=""
  86. compiler: ": #stack default osx"
  87. os: osx
  88. # Travis includes an macOS which is incompatible with GHC 7.8.4
  89. #- env: BUILD=stack ARGS="--resolver lts-2" STACK_YAML="stack-lts-2.yaml"
  90. # compiler: ": #stack 7.8.4 osx"
  91. # os: osx
  92. - env: BUILD=stack ARGS="--resolver lts-3"
  93. compiler: ": #stack 7.10.2 osx"
  94. os: osx
  95. - env: BUILD=stack ARGS="--resolver lts-6"
  96. compiler: ": #stack 7.10.3 osx"
  97. os: osx
  98. - env: BUILD=stack ARGS="--resolver lts-7"
  99. compiler: ": #stack 8.0.1 osx"
  100. os: osx
  101. - env: BUILD=stack ARGS="--resolver lts-8"
  102. compiler: ": #stack 8.0.2 osx"
  103. os: osx
  104. - env: BUILD=stack ARGS="--resolver nightly"
  105. compiler: ": #stack nightly osx"
  106. os: osx
  107. allow_failures:
  108. - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7
  109. - env: BUILD=stack ARGS="--resolver nightly"
  110. before_install:
  111. # Using compiler above sets CC to an invalid value, so unset it
  112. - unset CC
  113. # We want to always allow newer versions of packages when building on GHC HEAD
  114. - CABALARGS=""
  115. - if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi
  116. # Download and unpack the stack executable
  117. - 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
  118. - mkdir -p ~/.local/bin
  119. - |
  120. if [ `uname` = "Darwin" ]
  121. then
  122. travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin
  123. else
  124. travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
  125. fi
  126. # Use the more reliable S3 mirror of Hackage
  127. mkdir -p $HOME/.cabal
  128. echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config
  129. echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config
  130. if [ "$CABALVER" != "1.16" ]
  131. then
  132. echo 'jobs: $ncpus' >> $HOME/.cabal/config
  133. fi
  134. install:
  135. - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
  136. - if [ -f configure.ac ]; then autoreconf -i; fi
  137. - |
  138. set -ex
  139. case "$BUILD" in
  140. stack)
  141. stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies
  142. ;;
  143. cabal)
  144. cabal --version
  145. travis_retry cabal update
  146. # Get the list of packages from the stack.yaml file
  147. PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
  148. cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
  149. ;;
  150. esac
  151. set +ex
  152. script:
  153. - |
  154. set -ex
  155. case "$BUILD" in
  156. stack)
  157. stack --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps
  158. ;;
  159. cabal)
  160. cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
  161. ORIGDIR=$(pwd)
  162. for dir in $PACKAGES
  163. do
  164. cd $dir
  165. cabal check || [ "$CABALVER" == "1.16" ]
  166. cabal sdist
  167. PKGVER=$(cabal info . | awk '{print $2;exit}')
  168. SRC_TGZ=$PKGVER.tar.gz
  169. cd dist
  170. tar zxfv "$SRC_TGZ"
  171. cd "$PKGVER"
  172. cabal configure --enable-tests
  173. cabal build
  174. cd $ORIGDIR
  175. done
  176. ;;
  177. esac
  178. set +ex
  179. # Deployment to Hackage configuration
  180. deploy:
  181. provider: hackage
  182. username: brcha
  183. password:
  184. secure: zAy/Vsc0HmZRQKIoNu03SxltzWK13bfX9vqfc6/dLy3YyF7L6RIS2qrVih+ymJ/JHnmSkvtlUTxMSLoXI7md1sSDLKvkYZ9SpYzNtBN2hJWXsbc/Iec35cDoqYEYTfh5g9GSAW4JPzlaSONIndc6vKVPF7yqacx66sfwRveEpCWXYI/oh+5ssHLITWRUSHEikQ6EJ5+DQYBVg+V+C5m81OGWLTJhKOhj00dZ2gQMsr8aY8wWZyDqUH/czHyxsshgkXpKTlP2zEu/jAod4WCt3aMYLDzSxKVVcPgEn/m3HqQCazUcWC1TUbUvPb3n4wUzvjqB1xDuzfrFcBb9/IrdBG1mZhKNv0QF2DjQ22L/DisIqm/ZwJwibTjvr2W2xxrUB794En4pnL9U5laS7eqLpmC5ayAEJB1v2Qx3KV1D84bC2cRlgi+MV/5olN0YDLdWEqA2g8OLOSOPMZQdlyYdAnQR9B3lA6o/dPAafRoNSRzwYFuCt8mpMfbFHF6Wpn3oU9PqaRcqBML7qnvD7THIZ78gfuwst/Z8YQ8Y7sp/u1V128HqJB6AJ4j6I0dh3qaJb5k/2jNpWdQIoSz4GsiZArDY+oPD0Id9SITXRvIWHXlAGIT2BlDPU5sFyzRp5k8NpJ2cMCRDsSKGZAQU55srJHzU3bABC9pl/HTytgI8RYg=
  185. on:
  186. repo: brcha/shakespeare-sass
  187. tags: true