|
1 | 1 | # This Travis job script has been generated by a script via
|
2 | 2 | #
|
3 |
| -# runghc make_travis_yml_2.hs 'io-streams-haproxy.cabal' |
| 3 | +# haskell-ci 'io-streams-haproxy.cabal' |
| 4 | +# |
| 5 | +# To regenerate the script (for example after adjusting tested-with) run |
| 6 | +# |
| 7 | +# haskell-ci regenerate |
4 | 8 | #
|
5 | 9 | # For more information, see https://github.com/haskell-CI/haskell-ci
|
6 | 10 | #
|
| 11 | +# version: 0.10.1 |
| 12 | +# |
| 13 | +version: ~> 1.0 |
7 | 14 | language: c
|
8 |
| -sudo: false |
9 |
| - |
| 15 | +os: linux |
| 16 | +dist: xenial |
10 | 17 | git:
|
11 |
| - submodules: false # whether to recursively clone submodules |
12 |
| - |
| 18 | + # whether to recursively clone submodules |
| 19 | + submodules: false |
13 | 20 | cache:
|
14 | 21 | directories:
|
15 | 22 | - $HOME/.cabal/packages
|
16 | 23 | - $HOME/.cabal/store
|
17 |
| - |
| 24 | + - $HOME/.hlint |
18 | 25 | before_cache:
|
19 |
| - - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log |
| 26 | + - rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log |
20 | 27 | # 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: |
| 28 | + - rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.* |
| 29 | + - rm -fv $CABALHOME/packages/hackage.haskell.org/*.json |
| 30 | + - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache |
| 31 | + - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar |
| 32 | + - rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx |
| 33 | + - rm -rfv $CABALHOME/packages/head.hackage |
| 34 | +jobs: |
30 | 35 | include:
|
31 |
| - - compiler: "ghc-8.8.1" |
32 |
| - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-3.0,ghc-8.8.1], sources: [hvr-ghc]}} |
33 |
| - - compiler: "ghc-8.6.1" |
34 |
| - # env: TEST=--disable-tests BENCH=--disable-benchmarks |
35 |
| - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.1], sources: [hvr-ghc]}} |
36 |
| - - compiler: "ghc-8.4.3" |
37 |
| - # env: TEST=--disable-tests BENCH=--disable-benchmarks |
38 |
| - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.3], sources: [hvr-ghc]}} |
39 |
| - - compiler: "ghc-8.2.1" |
40 |
| - # env: TEST=--disable-tests BENCH=--disable-benchmarks |
41 |
| - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.1], sources: [hvr-ghc]}} |
42 |
| - - compiler: "ghc-8.0.1" |
43 |
| - # env: TEST=--disable-tests BENCH=--disable-benchmarks |
44 |
| - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.1], sources: [hvr-ghc]}} |
45 |
| - - compiler: "ghc-7.10.3" |
46 |
| - # env: TEST=--disable-tests BENCH=--disable-benchmarks |
47 |
| - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}} |
48 |
| - - compiler: "ghc-7.8.4" |
49 |
| - # env: TEST=--disable-tests BENCH=--disable-benchmarks |
50 |
| - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.4], sources: [hvr-ghc]}} |
51 |
| - - compiler: "ghc-7.6.3" |
52 |
| - # env: TEST=--disable-tests BENCH=--disable-benchmarks |
53 |
| - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.6.3], sources: [hvr-ghc]}} |
54 |
| - - compiler: "ghc-7.4.2" |
55 |
| - # env: TEST=--disable-tests BENCH=--disable-benchmarks |
56 |
| - addons: {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.4.2], sources: [hvr-ghc]}} |
57 |
| - |
| 36 | + - compiler: ghc-8.10.1 |
| 37 | + addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.10.1","cabal-install-3.2"]}} |
| 38 | + os: linux |
| 39 | + - compiler: ghc-8.8.3 |
| 40 | + addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.8.3","cabal-install-3.2"]}} |
| 41 | + os: linux |
| 42 | + - compiler: ghc-8.6.1 |
| 43 | + addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.1","cabal-install-3.2"]}} |
| 44 | + os: linux |
| 45 | + - compiler: ghc-8.4.3 |
| 46 | + addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.4.3","cabal-install-3.2"]}} |
| 47 | + os: linux |
| 48 | + - compiler: ghc-8.2.1 |
| 49 | + addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.2.1","cabal-install-3.2"]}} |
| 50 | + os: linux |
| 51 | + - compiler: ghc-8.0.1 |
| 52 | + addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.0.1","cabal-install-3.2"]}} |
| 53 | + os: linux |
| 54 | + - compiler: ghc-7.10.3 |
| 55 | + addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.10.3","cabal-install-3.2"]}} |
| 56 | + os: linux |
| 57 | + - compiler: ghc-7.8.4 |
| 58 | + addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.8.4","cabal-install-3.2"]}} |
| 59 | + os: linux |
| 60 | + - compiler: ghc-7.6.3 |
| 61 | + addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.6.3","cabal-install-3.2"]}} |
| 62 | + os: linux |
| 63 | + - compiler: ghc-7.4.2 |
| 64 | + addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.4.2","cabal-install-3.2"]}} |
| 65 | + os: linux |
58 | 66 | before_install:
|
59 |
| - - HC=${CC} |
60 |
| - - HCPKG=${HC/ghc/ghc-pkg} |
| 67 | + - HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//') |
| 68 | + - WITHCOMPILER="-w $HC" |
| 69 | + - HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//') |
| 70 | + - HCPKG="$HC-pkg" |
61 | 71 | - unset CC
|
62 |
| - - ROOTDIR=$(pwd) |
63 |
| - - mkdir -p $HOME/.local/bin |
64 |
| - - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH" |
65 |
| - - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') )) |
| 72 | + - CABAL=/opt/ghc/bin/cabal |
| 73 | + - CABALHOME=$HOME/.cabal |
| 74 | + - export PATH="$CABALHOME/bin:$PATH" |
| 75 | + - TOP=$(pwd) |
| 76 | + - "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')" |
66 | 77 | - echo $HCNUMVER
|
67 |
| - |
| 78 | + - CABAL="$CABAL -vnormal+nowrap" |
| 79 | + - set -o pipefail |
| 80 | + - TEST=--enable-tests |
| 81 | + - BENCH=--enable-benchmarks |
| 82 | + - HEADHACKAGE=false |
| 83 | + - rm -f $CABALHOME/config |
| 84 | + - | |
| 85 | + echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config |
| 86 | + echo "remote-build-reporting: anonymous" >> $CABALHOME/config |
| 87 | + echo "write-ghc-environment-files: always" >> $CABALHOME/config |
| 88 | + echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config |
| 89 | + echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config |
| 90 | + echo "world-file: $CABALHOME/world" >> $CABALHOME/config |
| 91 | + echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config |
| 92 | + echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config |
| 93 | + echo "installdir: $CABALHOME/bin" >> $CABALHOME/config |
| 94 | + echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config |
| 95 | + echo "store-dir: $CABALHOME/store" >> $CABALHOME/config |
| 96 | + echo "install-dirs user" >> $CABALHOME/config |
| 97 | + echo " prefix: $CABALHOME" >> $CABALHOME/config |
| 98 | + echo "repository hackage.haskell.org" >> $CABALHOME/config |
| 99 | + echo " url: http://hackage.haskell.org/" >> $CABALHOME/config |
68 | 100 | install:
|
69 |
| - - cabal --version |
| 101 | + - ${CABAL} --version |
70 | 102 | - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
|
71 |
| - - BENCH=${BENCH---enable-benchmarks} |
72 |
| - - TEST=${TEST---enable-tests} |
73 |
| - - HADDOCK=${HADDOCK-true} |
74 |
| - - UNCONSTRAINED=${UNCONSTRAINED-true} |
75 |
| - - NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false} |
76 |
| - - GHCHEAD=${GHCHEAD-false} |
77 |
| - - travis_retry cabal update -v |
78 |
| - - cabal outdated --exit-code |
79 |
| - - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config" |
80 |
| - - rm -fv cabal.project cabal.project.local |
81 |
| - - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$' |
82 |
| - - "printf 'packages: \".\"\\n' > cabal.project" |
83 |
| - - "printf 'write-ghc-environment-files: always\\n' >> cabal.project" |
84 |
| - - touch cabal.project.local |
85 |
| - - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- io-streams-haproxy | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi" |
| 103 | + - | |
| 104 | + echo "program-default-options" >> $CABALHOME/config |
| 105 | + echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config |
| 106 | + - cat $CABALHOME/config |
| 107 | + - rm -fv cabal.project cabal.project.local cabal.project.freeze |
| 108 | + - travis_retry ${CABAL} v2-update -v |
| 109 | + # Generate cabal.project |
| 110 | + - rm -rf cabal.project cabal.project.local cabal.project.freeze |
| 111 | + - touch cabal.project |
| 112 | + - | |
| 113 | + echo "packages: ." >> cabal.project |
| 114 | + - if [ $HCNUMVER -ge 80200 ] ; then echo 'package io-streams-haproxy' >> cabal.project ; fi |
| 115 | + - "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi" |
| 116 | + - | |
| 117 | + - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(io-streams-haproxy)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" |
86 | 118 | - cat cabal.project || true
|
87 | 119 | - cat cabal.project.local || true
|
88 |
| - - if [ -f "./configure.ac" ]; then |
89 |
| - (cd "." && autoreconf -i); |
90 |
| - fi |
91 |
| - - rm -f cabal.project.freeze |
92 |
| - - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all |
93 |
| - - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all |
94 |
| - - rm -rf .ghc.environment.* "."/dist |
95 |
| - - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) |
96 |
| - |
97 |
| -# Here starts the actual work to be performed for the package under test; |
98 |
| -# any command which exits with a non-zero exit code causes the build to fail. |
| 120 | + - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi |
| 121 | + - ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH} |
| 122 | + - "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'" |
| 123 | + - rm cabal.project.freeze |
| 124 | + - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all |
| 125 | + - travis_wait 40 ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all |
99 | 126 | script:
|
100 |
| - # test that source-distributions can be generated |
101 |
| - - cabal new-sdist all |
| 127 | + - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX) |
| 128 | + # Packaging... |
| 129 | + - ${CABAL} v2-sdist all |
| 130 | + # Unpacking... |
102 | 131 | - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
|
103 | 132 | - cd ${DISTDIR} || false
|
104 |
| - - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \; |
105 |
| - - "printf 'packages: io-streams-haproxy-*/*.cabal\\n' > cabal.project" |
106 |
| - - "printf 'write-ghc-environment-files: always\\n' >> cabal.project" |
107 |
| - - touch cabal.project.local |
108 |
| - - "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- io-streams-haproxy | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi" |
| 133 | + - find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \; |
| 134 | + - find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \; |
| 135 | + - PKGDIR_io_streams_haproxy="$(find . -maxdepth 1 -type d -regex '.*/io-streams-haproxy-[0-9.]*')" |
| 136 | + # Generate cabal.project |
| 137 | + - rm -rf cabal.project cabal.project.local cabal.project.freeze |
| 138 | + - touch cabal.project |
| 139 | + - | |
| 140 | + echo "packages: ${PKGDIR_io_streams_haproxy}" >> cabal.project |
| 141 | + - if [ $HCNUMVER -ge 80200 ] ; then echo 'package io-streams-haproxy' >> cabal.project ; fi |
| 142 | + - "if [ $HCNUMVER -ge 80200 ] ; then echo ' ghc-options: -Werror=missing-methods' >> cabal.project ; fi" |
| 143 | + - | |
| 144 | + - "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(io-streams-haproxy)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done" |
109 | 145 | - cat cabal.project || true
|
110 | 146 | - cat cabal.project.local || true
|
| 147 | + # Building... |
111 | 148 | # this builds all libraries and executables (without tests/benchmarks)
|
112 |
| - - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all |
113 |
| - |
| 149 | + - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all |
| 150 | + # Building with tests and benchmarks... |
114 | 151 | # build & run tests, build benchmarks
|
115 |
| - - cabal new-build -w ${HC} ${TEST} ${BENCH} all |
116 |
| - - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi |
117 |
| - |
118 |
| - # cabal check |
119 |
| - - (cd io-streams-haproxy-* && cabal check) |
120 |
| - |
121 |
| - # haddock |
122 |
| - - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi |
123 |
| - |
124 |
| - # Build without installed constraints for packages in global-db |
125 |
| - - 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 |
| 152 | + - ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all |
| 153 | + # Testing... |
| 154 | + - ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all |
| 155 | + # cabal check... |
| 156 | + - (cd ${PKGDIR_io_streams_haproxy} && ${CABAL} -vnormal check) |
| 157 | + # haddock... |
| 158 | + - ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all |
| 159 | + # Building without installed constraints for packages in global-db... |
| 160 | + - rm -f cabal.project.local |
| 161 | + - ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all |
126 | 162 |
|
127 |
| -# REGENDATA ["io-streams-haproxy.cabal"] |
| 163 | +# REGENDATA ("0.10.1",["io-streams-haproxy.cabal"]) |
128 | 164 | # EOF
|
0 commit comments