Unofficial mirror of https://github.com/xmonad/xmonad
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 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # This Travis job script has been generated by a script via
  2. #
  3. # runghc make_travis_yml_2.hs '-o' '.travis.yml' 'xmonad.cabal' 'libxrandr-dev'
  4. #
  5. # For more information, see https://github.com/haskell-CI/haskell-ci
  6. #
  7. language: c
  8. sudo: false
  9. git:
  10. submodules: false # whether to recursively clone submodules
  11. cache:
  12. directories:
  13. - $HOME/.cabal/packages
  14. - $HOME/.cabal/store
  15. before_cache:
  16. - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
  17. # remove files that are regenerated by 'cabal update'
  18. - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
  19. - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
  20. - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
  21. - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
  22. - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
  23. - rm -rfv $HOME/.cabal/packages/head.hackage
  24. matrix:
  25. include:
  26. - compiler: "ghc-8.6.1"
  27. env: GHCHEAD=true
  28. addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.6.1,libxrandr-dev], sources: [hvr-ghc]}}
  29. - compiler: "ghc-8.4.3"
  30. # env: TEST=--disable-tests BENCH=--disable-benchmarks
  31. addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.3,libxrandr-dev], sources: [hvr-ghc]}}
  32. - compiler: "ghc-8.2.2"
  33. # env: TEST=--disable-tests BENCH=--disable-benchmarks
  34. addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.2.2,libxrandr-dev], sources: [hvr-ghc]}}
  35. - compiler: "ghc-8.0.2"
  36. # env: TEST=--disable-tests BENCH=--disable-benchmarks
  37. addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.0.2,libxrandr-dev], sources: [hvr-ghc]}}
  38. allow_failures:
  39. - compiler: "ghc-8.6.1"
  40. before_install:
  41. - HC=${CC}
  42. - HCPKG=${HC/ghc/ghc-pkg}
  43. - unset CC
  44. - ROOTDIR=$(pwd)
  45. - mkdir -p $HOME/.local/bin
  46. - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
  47. - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
  48. - echo $HCNUMVER
  49. install:
  50. - cabal --version
  51. - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
  52. - BENCH=${BENCH---enable-benchmarks}
  53. - TEST=${TEST---enable-tests}
  54. - HADDOCK=${HADDOCK-true}
  55. - UNCONSTRAINED=${UNCONSTRAINED-true}
  56. - NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}
  57. - GHCHEAD=${GHCHEAD-false}
  58. - travis_retry cabal update -v
  59. - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
  60. - rm -fv cabal.project cabal.project.local
  61. # Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage
  62. - |
  63. if $GHCHEAD; then
  64. sed -i 's/-- allow-newer: .*/allow-newer: *:base/' ${HOME}/.cabal/config
  65. for pkg in $($HCPKG list --simple-output); do pkg=$(echo $pkg | sed 's/-[^-]*$//'); sed -i "s/allow-newer: /allow-newer: *:$pkg, /" ${HOME}/.cabal/config; done
  66. echo 'repository head.hackage' >> ${HOME}/.cabal/config
  67. echo ' url: http://head.hackage.haskell.org/' >> ${HOME}/.cabal/config
  68. echo ' secure: True' >> ${HOME}/.cabal/config
  69. echo ' root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> ${HOME}/.cabal/config
  70. echo ' 2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> ${HOME}/.cabal/config
  71. echo ' 8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config
  72. echo ' key-threshold: 3' >> ${HOME}/.cabal.config
  73. grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
  74. cabal new-update head.hackage -v
  75. fi
  76. - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
  77. - "printf 'packages: \".\"\\n' > cabal.project"
  78. - "if [ $HCNUMVER -lt 80600 ]; then printf 'package xmonad\\n flags: +generatemanpage\n' >> cabal.project; fi"
  79. - touch cabal.project.local
  80. - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- xmonad | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
  81. - cat cabal.project || true
  82. - cat cabal.project.local || true
  83. - if [ -f "./configure.ac" ]; then
  84. (cd "." && autoreconf -i);
  85. fi
  86. - rm -f cabal.project.freeze
  87. - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
  88. - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
  89. - rm -rf .ghc.environment.* "."/dist
  90. - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
  91. # Here starts the actual work to be performed for the package under test;
  92. # any command which exits with a non-zero exit code causes the build to fail.
  93. script:
  94. # test that source-distributions can be generated
  95. - (cd "." && cabal sdist)
  96. - mv "."/dist/xmonad-*.tar.gz ${DISTDIR}/
  97. - cd ${DISTDIR} || false
  98. - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
  99. - "printf 'packages: xmonad-*/*.cabal\\n' > cabal.project"
  100. - "if [ $HCNUMVER -lt 80600 ]; then printf 'package xmonad\\n flags: +generatemanpage\n' >> cabal.project; fi"
  101. - touch cabal.project.local
  102. - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- xmonad | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
  103. - cat cabal.project || true
  104. - cat cabal.project.local || true
  105. # this builds all libraries and executables (without tests/benchmarks)
  106. - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
  107. # build & run tests, build benchmarks
  108. - cabal new-build -w ${HC} ${TEST} ${BENCH} all
  109. - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi
  110. # cabal check
  111. - (cd xmonad-* && cabal check)
  112. # haddock
  113. - rm -rf ./dist-newstyle
  114. - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
  115. # Build without installed constraints for packages in global-db
  116. - if $UNCONSTRAINED; then rm -f cabal.project.local; echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks all; else echo "Not building without installed constraints"; fi
  117. # REGENDATA ["-o",".travis.yml","xmonad.cabal","libxrandr-dev"]
  118. # EOF