You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.travis.yml 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # This file has been generated -- see https://github.com/hvr/multi-ghc-travis
  2. language: c
  3. sudo: false
  4. cache:
  5. directories:
  6. - $HOME/.cabsnap
  7. - $HOME/.cabal/packages
  8. before_cache:
  9. - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
  10. - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
  11. matrix:
  12. include:
  13. - env: GHCVER=8.6.1 CABALVER=2.4
  14. compiler: ": #GHC 8.6.1"
  15. addons: { apt: { packages: [cabal-install-2.4, ghc-8.6.1, libxrandr-dev]
  16. , sources: [hvr-ghc]
  17. } }
  18. - env: GHCVER=8.4.3 CABALVER=2.2
  19. compiler: ": #GHC 8.4.3"
  20. addons: { apt: { packages: [cabal-install-2.2, ghc-8.4.3, libxrandr-dev]
  21. , sources: [hvr-ghc]
  22. } }
  23. - env: GHCVER=8.2.2 CABALVER=2.0
  24. compiler: ": #GHC 8.2.2"
  25. addons: { apt: { packages: [cabal-install-2.0, ghc-8.2.2, libxrandr-dev]
  26. , sources: [hvr-ghc]
  27. } }
  28. - env: GHCVER=8.0.1 CABALVER=1.24
  29. compiler: ": #GHC 8.0.1"
  30. addons: { apt: { packages: [cabal-install-1.24, ghc-8.0.1, libxrandr-dev]
  31. , sources: [hvr-ghc]
  32. } }
  33. before_install:
  34. - unset CC
  35. - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
  36. install:
  37. - cabal --version
  38. - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
  39. - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
  40. then
  41. zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
  42. $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
  43. fi
  44. - travis_retry cabal update -v
  45. # build xmonad from HEAD
  46. - git clone https://github.com/xmonad/xmonad.git
  47. - cabal install xmonad/
  48. - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
  49. - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
  50. - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
  51. # check whether current requested install-plan matches cached package-db snapshot
  52. - if diff -u $HOME/.cabsnap/installplan.txt installplan.txt;
  53. then
  54. echo "cabal build-cache HIT";
  55. rm -rfv .ghc;
  56. cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
  57. cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
  58. else
  59. echo "cabal build-cache MISS";
  60. rm -rf $HOME/.cabsnap;
  61. mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
  62. fi
  63. - cabal install --only-dependencies --enable-tests --enable-benchmarks;
  64. # snapshot package-db on cache miss
  65. - if [ ! -d $HOME/.cabsnap ];
  66. then
  67. echo "snapshotting package-db to build-cache";
  68. mkdir $HOME/.cabsnap;
  69. cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
  70. cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
  71. fi
  72. # Here starts the actual work to be performed for the package under test;
  73. # any command which exits with a non-zero exit code causes the build to fail.
  74. script:
  75. - if [ -f configure.ac ]; then autoreconf -i; fi
  76. - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
  77. - cabal build # this builds all libraries and executables (including tests/benchmarks)
  78. - cabal test
  79. # - cabal check # complains about -Werror even though it is
  80. # hidden behind a manual flag with default false
  81. - cabal sdist # tests that a source-distribution can be generated
  82. # Check that the resulting source distribution can be built & installed.
  83. # If there are no other `.tar.gz` files in `dist`, this can be even simpler:
  84. # `cabal install --force-reinstalls dist/*-*.tar.gz`
  85. - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
  86. (cd dist && cabal install --force-reinstalls "$SRC_TGZ")
  87. # EOF