Regenerate .travis.yml
[packages/unix.git] / .travis.yml
1 # This Travis job script has been generated by a script via
2 #
3 #   haskell-ci '--output=.travis.yml' '--config=cabal.haskell-ci' 'cabal.project'
4 #
5 # For more information, see https://github.com/haskell-CI/haskell-ci
6 #
7 # version: 0.2.1
8 #
9 language: c
10 dist: xenial
11
12 git:
13   submodules: false  # whether to recursively clone submodules
14
15 cache:
16   directories:
17     - $HOME/.cabal/packages
18     - $HOME/.cabal/store
19
20 before_cache:
21   - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
22   # remove files that are regenerated by 'cabal update'
23   - rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
24   - rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
25   - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
26   - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
27   - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
28
29   - rm -rfv $CABALHOME/packages/head.hackage
30
31 matrix:
32   include:
33     - compiler: "ghc-8.6.4"
34       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.4], sources: [hvr-ghc]}}
35     - compiler: "ghc-8.6.3"
36       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.3], sources: [hvr-ghc]}}
37     - compiler: "ghc-8.6.2"
38       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.2], sources: [hvr-ghc]}}
39     - compiler: "ghc-8.6.1"
40       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.1], sources: [hvr-ghc]}}
41     - compiler: "ghc-8.4.4"
42       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}}
43     - compiler: "ghc-8.4.3"
44       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.3], sources: [hvr-ghc]}}
45     - compiler: "ghc-8.4.2"
46       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.2], sources: [hvr-ghc]}}
47     - compiler: "ghc-8.4.1"
48       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.1], sources: [hvr-ghc]}}
49     - compiler: "ghc-8.2.2"
50       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}}
51     - compiler: "ghc-8.2.1"
52       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.1], sources: [hvr-ghc]}}
53     - compiler: "ghc-8.0.2"
54       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}}
55     - compiler: "ghc-8.0.1"
56       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.1], sources: [hvr-ghc]}}
57     - compiler: "ghc-7.10.3"
58       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}}
59     - compiler: "ghc-7.10.2"
60       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.2], sources: [hvr-ghc]}}
61     - compiler: "ghc-7.10.1"
62       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.1], sources: [hvr-ghc]}}
63     - compiler: "ghc-7.8.4"
64       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.4], sources: [hvr-ghc]}}
65     - compiler: "ghc-7.8.3"
66       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.3], sources: [hvr-ghc]}}
67     - compiler: "ghc-7.8.2"
68       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.2], sources: [hvr-ghc]}}
69     - compiler: "ghc-7.8.1"
70       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.1], sources: [hvr-ghc]}}
71     - compiler: "ghc-7.6.3"
72       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.6.3], sources: [hvr-ghc]}}
73     - compiler: "ghc-7.6.2"
74       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.6.2], sources: [hvr-ghc]}}
75     - compiler: "ghc-7.6.1"
76       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.6.1], sources: [hvr-ghc]}}
77     - compiler: "ghc-7.4.2"
78       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.4.2], sources: [hvr-ghc]}}
79     - compiler: "ghc-7.4.1"
80       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.4.1], sources: [hvr-ghc]}}
81     - compiler: "ghc-head"
82       env: GHCHEAD=true
83       addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-head], sources: [hvr-ghc]}}
84
85   allow_failures:
86     - compiler: "ghc-head"
87
88 before_install:
89   - HC=/opt/ghc/bin/${CC}
90   - HCPKG=${HC/ghc/ghc-pkg}
91   - unset CC
92   - CABAL=/opt/ghc/bin/cabal
93   - CABALHOME=$HOME/.cabal
94   - export PATH="$CABALHOME/bin:$PATH"
95   - ROOTDIR=$(pwd)
96   - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
97   - echo $HCNUMVER
98
99 install:
100   - ${CABAL} --version
101   - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
102   - TEST=--enable-tests
103   - BENCH=--enable-benchmarks
104   - GHCHEAD=${GHCHEAD-false}
105   - travis_retry ${CABAL} update -v
106   - sed -i.bak 's/^jobs:/-- jobs:/' $CABALHOME/config
107   - rm -fv cabal.project cabal.project.local
108   # Overlay Hackage Package Index for GHC HEAD: https://github.com/hvr/head.hackage
109   - |
110     if $GHCHEAD; then
111       sed -i 's/-- allow-newer: .*/allow-newer: *:base/' $CABALHOME/config
112       for pkg in $($HCPKG list --simple-output); do pkg=$(echo $pkg | sed 's/-[^-]*$//'); sed -i "s/allow-newer: /allow-newer: *:$pkg, /" $CABALHOME/config; done
113
114       echo 'repository head.hackage'                                                        >> $CABALHOME/config
115       echo '   url: http://head.hackage.haskell.org/'                                       >> $CABALHOME/config
116       echo '   secure: True'                                                                >> $CABALHOME/config
117       echo '   root-keys: 07c59cb65787dedfaef5bd5f987ceb5f7e5ebf88b904bbd4c5cbdeb2ff71b740' >> $CABALHOME/config
118       echo '              2e8555dde16ebd8df076f1a8ef13b8f14c66bad8eafefd7d9e37d0ed711821fb' >> $CABALHOME/config
119       echo '              8f79fd2389ab2967354407ec852cbe73f2e8635793ac446d09461ffb99527f6e' >> $CABALHOME/config
120       echo '   key-threshold: 3'                                                            >> $CABALHOME.config
121
122       grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$'
123
124       ${CABAL} new-update head.hackage -v
125     fi
126   - grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$'
127   - rm -f cabal.project
128   - touch cabal.project
129   - "printf 'packages: \".\"\\n' >> cabal.project"
130   - "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
131   - touch cabal.project.local
132   - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(unix)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
133   - cat cabal.project || true
134   - cat cabal.project.local || true
135   - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
136   - rm -f cabal.project.freeze
137   - ${CABAL} new-freeze -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dry
138   - "cat \"cabal.project.freeze\" | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
139   - rm  "cabal.project.freeze"
140   - ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
141   - ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
142   - rm -rf .ghc.environment.* "."/dist
143   - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
144
145 # Here starts the actual work to be performed for the package under test;
146 # any command which exits with a non-zero exit code causes the build to fail.
147 script:
148   # test that source-distributions can be generated
149   - ${CABAL} new-sdist all
150   - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
151   - cd ${DISTDIR} || false
152   - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
153   - rm -f cabal.project
154   - touch cabal.project
155   - "printf 'packages: \"unix-*/*.cabal\"\\n' >> cabal.project"
156   - "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
157   - touch cabal.project.local
158   - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(unix)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
159   - cat cabal.project || true
160   - cat cabal.project.local || true
161   # this builds all libraries and executables (without tests/benchmarks)
162   - ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all
163
164   # build & run tests, build benchmarks
165   - ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all
166
167   # cabal check
168   - (cd unix-* && ${CABAL} check)
169
170   # haddock
171   - ${CABAL} new-haddock -w ${HC} ${TEST} ${BENCH} all
172
173 # REGENDATA ["--output=.travis.yml","--config=cabal.haskell-ci","cabal.project"]
174 # EOF