Update .travis.yaml
[list-fusion-probe.git] / .travis.yml
1 # This Travis job script has been generated by a script via
2 #
3 #   make_travis_yml_2.hs 'list-fusion-probe.cabal'
4 #
5 # For more information, see https://github.com/hvr/multi-ghc-travis
6 #
7 language: c
8 sudo: false
9
10 git:
11   submodules: false  # whether to recursively clone submodules
12
13 cache:
14   directories:
15     - $HOME/.cabal/packages
16     - $HOME/.cabal/store
17
18 before_cache:
19   - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
20   # remove files that are regenerated by 'cabal update'
21   - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
22   - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
23   - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
24   - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
25   - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
26
27 matrix:
28   include:
29     - compiler: "ghc-7.6.1"
30     # env: TEST=--disable-tests BENCH=--disable-benchmarks
31       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.6.1], sources: [hvr-ghc]}}
32     - compiler: "ghc-7.6.2"
33     # env: TEST=--disable-tests BENCH=--disable-benchmarks
34       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.6.2], sources: [hvr-ghc]}}
35     - compiler: "ghc-7.6.3"
36     # env: TEST=--disable-tests BENCH=--disable-benchmarks
37       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.6.3], sources: [hvr-ghc]}}
38     - compiler: "ghc-7.8.1"
39     # env: TEST=--disable-tests BENCH=--disable-benchmarks
40       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.1], sources: [hvr-ghc]}}
41     - compiler: "ghc-7.8.2"
42     # env: TEST=--disable-tests BENCH=--disable-benchmarks
43       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.2], sources: [hvr-ghc]}}
44     - compiler: "ghc-7.8.3"
45     # env: TEST=--disable-tests BENCH=--disable-benchmarks
46       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.3], sources: [hvr-ghc]}}
47     - compiler: "ghc-7.8.4"
48     # env: TEST=--disable-tests BENCH=--disable-benchmarks
49       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
50     - compiler: "ghc-7.10.1"
51     # env: TEST=--disable-tests BENCH=--disable-benchmarks
52       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.1], sources: [hvr-ghc]}}
53     - compiler: "ghc-7.10.2"
54     # env: TEST=--disable-tests BENCH=--disable-benchmarks
55       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.2], sources: [hvr-ghc]}}
56     - compiler: "ghc-7.10.3"
57     # env: TEST=--disable-tests BENCH=--disable-benchmarks
58       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
59     - compiler: "ghc-8.0.1"
60     # env: TEST=--disable-tests BENCH=--disable-benchmarks
61       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.1], sources: [hvr-ghc]}}
62     - compiler: "ghc-8.0.2"
63     # env: TEST=--disable-tests BENCH=--disable-benchmarks
64       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
65     - compiler: "ghc-8.2.1"
66     # env: TEST=--disable-tests BENCH=--disable-benchmarks
67       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], sources: [hvr-ghc]}}
68     - compiler: "ghc-8.2.2"
69     # env: TEST=--disable-tests BENCH=--disable-benchmarks
70       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
71
72 before_install:
73   - HC=${CC}
74   - HCPKG=${HC/ghc/ghc-pkg}
75   - unset CC
76   - PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
77
78 install:
79   - cabal --version
80   - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
81   - BENCH=${BENCH---enable-benchmarks}
82   - TEST=${TEST---enable-tests}
83   - HADDOCK=${HADDOCK-true}
84   - INSTALLED=${INSTALLED-true}
85   - travis_retry cabal update -v
86   - sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
87   - rm -fv cabal.project.local
88   - "echo 'packages: .' > cabal.project"
89   - if [ -f "./configure.ac" ]; then
90       (cd "."; autoreconf -i);
91     fi
92   - rm -f cabal.project.freeze
93   - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
94   - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
95   - rm -rf "."/.ghc.environment.* "."/dist
96   - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
97
98 # Here starts the actual work to be performed for the package under test;
99 # any command which exits with a non-zero exit code causes the build to fail.
100 script:
101   # test that source-distributions can be generated
102   - (cd "."; cabal sdist)
103   - mv "."/dist/list-fusion-probe-*.tar.gz ${DISTDIR}/
104   - cd ${DISTDIR}
105   - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
106   - "printf 'packages: list-fusion-probe-*/*.cabal\n' > cabal.project"
107   # this builds all libraries and executables (without tests/benchmarks)
108   - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
109
110   # Build with installed constraints for packages in global-db
111   - if $INSTALLED; then
112       echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks $(${HCPKG} list --global --simple-output --names-only | sed 's/\([a-zA-Z0-9-]\{1,\}\) */--constraint="\1 installed" /g') all | sh;
113     else echo "Not building with installed constraints"; fi
114
115   # build & run tests, build benchmarks
116   - cabal new-build -w ${HC} ${TEST} ${BENCH} all
117   - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
118
119   # haddock
120   - rm -rf ./dist-newstyle
121   - if $HADDOCK; then cabal new-haddock -w ${HC} --disable-tests --disable-benchmarks all; else echo "Skipping haddock generation";fi
122
123 # REGENDATA ["list-fusion-probe.cabal"]
124 # EOF