Revert "Travis: Use GHC 8.6.1"
[packages/unix.git] / .travis.yml
1 # This Travis job script has been generated by a script via
2 #
3 #   runghc make_travis_yml_2.hs '-o' '.travis.yml' '--ghc-head' '--no-installed' 'cabal.project'
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   - rm -rfv $HOME/.cabal/packages/head.hackage
28
29 matrix:
30   include:
31     - compiler: "ghc-8.4.3"
32     # env: TEST=--disable-tests BENCH=--disable-benchmarks
33       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.3], sources: [hvr-ghc]}}
34     - compiler: "ghc-8.4.2"
35     # env: TEST=--disable-tests BENCH=--disable-benchmarks
36       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.2], sources: [hvr-ghc]}}
37     - compiler: "ghc-8.4.1"
38     # env: TEST=--disable-tests BENCH=--disable-benchmarks
39       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.1], sources: [hvr-ghc]}}
40     - compiler: "ghc-8.2.2"
41     # env: TEST=--disable-tests BENCH=--disable-benchmarks
42       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.2.2], sources: [hvr-ghc]}}
43     - compiler: "ghc-8.2.1"
44     # env: TEST=--disable-tests BENCH=--disable-benchmarks
45       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.2.1], sources: [hvr-ghc]}}
46     - compiler: "ghc-8.0.2"
47     # env: TEST=--disable-tests BENCH=--disable-benchmarks
48       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.0.2], sources: [hvr-ghc]}}
49     - compiler: "ghc-8.0.1"
50     # env: TEST=--disable-tests BENCH=--disable-benchmarks
51       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.0.1], sources: [hvr-ghc]}}
52     - compiler: "ghc-7.10.3"
53     # env: TEST=--disable-tests BENCH=--disable-benchmarks
54       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.10.3], sources: [hvr-ghc]}}
55     - compiler: "ghc-7.10.2"
56     # env: TEST=--disable-tests BENCH=--disable-benchmarks
57       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.10.2], sources: [hvr-ghc]}}
58     - compiler: "ghc-7.10.1"
59     # env: TEST=--disable-tests BENCH=--disable-benchmarks
60       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.10.1], sources: [hvr-ghc]}}
61     - compiler: "ghc-7.8.4"
62     # env: TEST=--disable-tests BENCH=--disable-benchmarks
63       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.8.4], sources: [hvr-ghc]}}
64     - compiler: "ghc-7.8.3"
65     # env: TEST=--disable-tests BENCH=--disable-benchmarks
66       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.8.3], sources: [hvr-ghc]}}
67     - compiler: "ghc-7.8.2"
68     # env: TEST=--disable-tests BENCH=--disable-benchmarks
69       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.8.2], sources: [hvr-ghc]}}
70     - compiler: "ghc-7.8.1"
71     # env: TEST=--disable-tests BENCH=--disable-benchmarks
72       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.8.1], sources: [hvr-ghc]}}
73     - compiler: "ghc-7.6.3"
74     # env: TEST=--disable-tests BENCH=--disable-benchmarks
75       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.6.3], sources: [hvr-ghc]}}
76     - compiler: "ghc-7.6.2"
77     # env: TEST=--disable-tests BENCH=--disable-benchmarks
78       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.6.2], sources: [hvr-ghc]}}
79     - compiler: "ghc-7.6.1"
80     # env: TEST=--disable-tests BENCH=--disable-benchmarks
81       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.6.1], sources: [hvr-ghc]}}
82     - compiler: "ghc-7.4.2"
83     # env: TEST=--disable-tests BENCH=--disable-benchmarks
84       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.4.2], sources: [hvr-ghc]}}
85     - compiler: "ghc-7.4.1"
86     # env: TEST=--disable-tests BENCH=--disable-benchmarks
87       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-7.4.1], sources: [hvr-ghc]}}
88     - compiler: "ghc-head"
89       env: GHCHEAD=true
90       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head], sources: [hvr-ghc]}}
91
92   allow_failures:
93     - compiler: "ghc-head"
94
95 before_install:
96   - HC=${CC}
97   - HCPKG=${HC/ghc/ghc-pkg}
98   - unset CC
99   - ROOTDIR=$(pwd)
100   - mkdir -p $HOME/.local/bin
101   - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
102   - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
103   - echo $HCNUMVER
104
105 install:
106   - cabal --version
107   - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
108   - BENCH=${BENCH---enable-benchmarks}
109   - TEST=${TEST---enable-tests}
110   - HADDOCK=${HADDOCK-true}
111   - INSTALLED=${INSTALLED-true}
112   - GHCHEAD=${GHCHEAD-false}
113   - travis_retry cabal update -v
114   - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
115   - rm -fv cabal.project cabal.project.local
116   # Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage
117   - |
118     if $GHCHEAD; then
119       sed -i.bak 's/-- allow-newer:.*/allow-newer: *:base, *:template-haskell, *:ghc, *:Cabal/' ${HOME}/.cabal/config
120
121       echo 'repository head.hackage'                                                        >> ${HOME}/.cabal/config
122       echo '   url: http://head.hackage.haskell.org/'                                       >> ${HOME}/.cabal/config
123       echo '   secure: True'                                                                >> ${HOME}/.cabal/config
124       echo '   root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> ${HOME}/.cabal/config
125       echo '              2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> ${HOME}/.cabal/config
126       echo '              8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> ${HOME}/.cabal/config
127       echo '   key-threshold: 3'                                                            >> ${HOME}/.cabal.config
128
129       cabal new-update head.hackage -v
130     fi
131   - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
132   - "printf 'packages: \".\"\\n' > cabal.project"
133   - cat cabal.project
134   - if [ -f "./configure.ac" ]; then
135       (cd "." && autoreconf -i);
136     fi
137   - rm -f cabal.project.freeze
138   - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
139   - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
140   - rm -rf .ghc.environment.* "."/dist
141   - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
142
143 # Here starts the actual work to be performed for the package under test;
144 # any command which exits with a non-zero exit code causes the build to fail.
145 script:
146   # test that source-distributions can be generated
147   - (cd "." && cabal sdist)
148   - mv "."/dist/unix-*.tar.gz ${DISTDIR}/
149   - cd ${DISTDIR} || false
150   - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
151   - "printf 'packages: unix-*/*.cabal\\n' > cabal.project"
152   - cat cabal.project
153   # this builds all libraries and executables (without tests/benchmarks)
154   - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
155
156
157   # build & run tests, build benchmarks
158   - cabal new-build -w ${HC} ${TEST} ${BENCH} all
159
160   # cabal check
161   - (cd unix-* && cabal check)
162
163   # haddock
164   - rm -rf ./dist-newstyle
165   - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
166
167 # REGENDATA ["-o",".travis.yml","--ghc-head","--no-installed","cabal.project"]
168 # EOF