11# This Travis job script has been generated by a script via
22#
3- # runghc make_travis_yml_2.hs '--output' '.travis.yml' 'stm.cabal'
3+ # haskell-ci '--output' '.travis.yml' 'stm.cabal'
44#
55# For more information, see https://github.com/haskell-CI/haskell-ci
66#
7+ # version: 0.2.1
8+ #
79language : c
8- sudo : false
10+ dist : xenial
911
1012git :
1113 submodules : false # whether to recursively clone submodules
@@ -16,172 +18,148 @@ cache:
1618 - $HOME/.cabal/store
1719
1820before_cache :
19- - rm -fv $HOME/.cabal /packages/hackage.haskell.org/build-reports.log
21+ - rm -fv $CABALHOME /packages/hackage.haskell.org/build-reports.log
2022 # 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
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
2628
27- - rm -rfv $HOME/.cabal /packages/head.hackage
29+ - rm -rfv $CABALHOME /packages/head.hackage
2830
2931matrix :
3032 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]}}
3135 - compiler : " ghc-8.6.3"
32- # env: TEST=--disable-tests BENCH=--disable-benchmarks
3336 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.3], sources: [hvr-ghc]}}
3437 - compiler : " ghc-8.6.2"
35- # env: TEST=--disable-tests BENCH=--disable-benchmarks
3638 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.2], sources: [hvr-ghc]}}
3739 - compiler : " ghc-8.6.1"
38- # env: TEST=--disable-tests BENCH=--disable-benchmarks
3940 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.1], sources: [hvr-ghc]}}
4041 - compiler : " ghc-8.4.4"
41- # env: TEST=--disable-tests BENCH=--disable-benchmarks
4242 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources: [hvr-ghc]}}
4343 - compiler : " ghc-8.4.3"
44- # env: TEST=--disable-tests BENCH=--disable-benchmarks
4544 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.3], sources: [hvr-ghc]}}
4645 - compiler : " ghc-8.4.2"
47- # env: TEST=--disable-tests BENCH=--disable-benchmarks
4846 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.2], sources: [hvr-ghc]}}
4947 - compiler : " ghc-8.4.1"
50- # env: TEST=--disable-tests BENCH=--disable-benchmarks
5148 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.1], sources: [hvr-ghc]}}
5249 - compiler : " ghc-8.2.2"
53- # env: TEST=--disable-tests BENCH=--disable-benchmarks
5450 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources: [hvr-ghc]}}
5551 - compiler : " ghc-8.2.1"
56- # env: TEST=--disable-tests BENCH=--disable-benchmarks
5752 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.1], sources: [hvr-ghc]}}
5853 - compiler : " ghc-8.0.2"
59- # env: TEST=--disable-tests BENCH=--disable-benchmarks
6054 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources: [hvr-ghc]}}
6155 - compiler : " ghc-8.0.1"
62- # env: TEST=--disable-tests BENCH=--disable-benchmarks
6356 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.1], sources: [hvr-ghc]}}
6457 - compiler : " ghc-7.10.3"
65- # env: TEST=--disable-tests BENCH=--disable-benchmarks
6658 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.3], sources: [hvr-ghc]}}
6759 - compiler : " ghc-7.10.2"
68- # env: TEST=--disable-tests BENCH=--disable-benchmarks
6960 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.2], sources: [hvr-ghc]}}
7061 - compiler : " ghc-7.10.1"
71- # env: TEST=--disable-tests BENCH=--disable-benchmarks
7262 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.10.1], sources: [hvr-ghc]}}
7363 - compiler : " ghc-7.8.4"
74- # env: TEST=--disable-tests BENCH=--disable-benchmarks
7564 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.4], sources: [hvr-ghc]}}
7665 - compiler : " ghc-7.8.3"
77- # env: TEST=--disable-tests BENCH=--disable-benchmarks
7866 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.3], sources: [hvr-ghc]}}
7967 - compiler : " ghc-7.8.2"
80- # env: TEST=--disable-tests BENCH=--disable-benchmarks
8168 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.2], sources: [hvr-ghc]}}
8269 - compiler : " ghc-7.8.1"
83- # env: TEST=--disable-tests BENCH=--disable-benchmarks
8470 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.8.1], sources: [hvr-ghc]}}
8571 - compiler : " ghc-7.6.3"
86- # env: TEST=--disable-tests BENCH=--disable-benchmarks
8772 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.6.3], sources: [hvr-ghc]}}
8873 - compiler : " ghc-7.6.2"
89- # env: TEST=--disable-tests BENCH=--disable-benchmarks
9074 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.6.2], sources: [hvr-ghc]}}
9175 - compiler : " ghc-7.6.1"
92- # env: TEST=--disable-tests BENCH=--disable-benchmarks
9376 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.6.1], sources: [hvr-ghc]}}
9477 - compiler : " ghc-7.4.2"
95- # env: TEST=--disable-tests BENCH=--disable-benchmarks
9678 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.4.2], sources: [hvr-ghc]}}
9779 - compiler : " ghc-7.4.1"
98- # env: TEST=--disable-tests BENCH=--disable-benchmarks
9980 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.4.1], sources: [hvr-ghc]}}
10081 - compiler : " ghc-7.2.2"
101- # env: TEST=--disable-tests BENCH=--disable-benchmarks
10282 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.2.2], sources: [hvr-ghc]}}
10383 - compiler : " ghc-7.2.1"
104- # env: TEST=--disable-tests BENCH=--disable-benchmarks
10584 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.2.1], sources: [hvr-ghc]}}
10685 - compiler : " ghc-7.0.4"
107- # env: TEST=--disable-tests BENCH=--disable-benchmarks
10886 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.0.4], sources: [hvr-ghc]}}
10987 - compiler : " ghc-7.0.3"
110- # env: TEST=--disable-tests BENCH=--disable-benchmarks
11188 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.0.3], sources: [hvr-ghc]}}
11289 - compiler : " ghc-7.0.2"
113- # env: TEST=--disable-tests BENCH=--disable-benchmarks
11490 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.0.2], sources: [hvr-ghc]}}
11591 - compiler : " ghc-7.0.1"
116- # env: TEST=--disable-tests BENCH=--disable-benchmarks
11792 addons : {apt: {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-7.0.1], sources: [hvr-ghc]}}
11893
11994before_install :
120- - HC=${CC}
95+ - HC=/opt/ghc/bin/ ${CC}
12196 - HCPKG=${HC/ghc/ghc-pkg}
12297 - unset CC
98+ - CABAL=/opt/ghc/bin/cabal
99+ - CABALHOME=$HOME/.cabal
100+ - export PATH="$CABALHOME/bin:$PATH"
123101 - ROOTDIR=$(pwd)
124- - mkdir -p $HOME/.local/bin
125- - " PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
126102 - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
127103 - echo $HCNUMVER
128104
129105install :
130- - cabal --version
106+ - ${CABAL} --version
131107 - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
132- - BENCH=${BENCH---enable-benchmarks}
133- - TEST=${TEST---enable-tests}
134- - HADDOCK=${HADDOCK-true}
135- - UNCONSTRAINED=${UNCONSTRAINED-true}
136- - NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}
108+ - TEST=--enable-tests
109+ - BENCH=--enable-benchmarks
137110 - GHCHEAD=${GHCHEAD-false}
138- - travis_retry cabal update -v
139- - " sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/ config"
111+ - travis_retry ${CABAL} update -v
112+ - sed -i.bak 's/^jobs:/-- jobs:/' $CABALHOME/ config
140113 - rm -fv cabal.project cabal.project.local
141- - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
142- - " printf 'packages: \" .\"\\ n' > cabal.project"
114+ - grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$'
115+ - rm -f cabal.project
116+ - touch cabal.project
117+ - " printf 'packages: \" .\"\\ n' >> cabal.project"
143118 - " printf 'write-ghc-environment-files: always\\ n' >> cabal.project"
144119 - touch cabal.project.local
145- - " if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- stm | sed 's/^/constraints: /' | sed 's/-[^-]* $/ installed/' >> cabal.project.local; done; fi "
120+ - " for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^( stm)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
146121 - cat cabal.project || true
147122 - cat cabal.project.local || true
148- - if [ -f "./configure.ac" ]; then
149- (cd "." && autoreconf -i);
150- fi
123+ - if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
151124 - rm -f cabal.project.freeze
152- - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
153- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
125+ - ${CABAL} new-freeze -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dry
126+ - " cat \" cabal.project.freeze\" | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
127+ - rm "cabal.project.freeze"
128+ - ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
129+ - ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
154130 - rm -rf .ghc.environment.* "."/dist
155131 - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
156132
157133# Here starts the actual work to be performed for the package under test;
158134# any command which exits with a non-zero exit code causes the build to fail.
159135script :
160136 # test that source-distributions can be generated
161- - cabal new-sdist all
137+ - ${CABAL} new-sdist all
162138 - mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
163139 - cd ${DISTDIR} || false
164140 - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
165- - " printf 'packages: stm-*/*.cabal\\ n' > cabal.project"
141+ - rm -f cabal.project
142+ - touch cabal.project
143+ - " printf 'packages: \" stm-*/*.cabal\"\\ n' >> cabal.project"
166144 - " printf 'write-ghc-environment-files: always\\ n' >> cabal.project"
167145 - touch cabal.project.local
168- - " if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- stm | sed 's/^/constraints: /' | sed 's/-[^-]* $/ installed/' >> cabal.project.local; done; fi "
146+ - " for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^( stm)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
169147 - cat cabal.project || true
170148 - cat cabal.project.local || true
171149 # this builds all libraries and executables (without tests/benchmarks)
172- - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
150+ - ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all
173151
174152 # build & run tests, build benchmarks
175- - cabal new-build -w ${HC} ${TEST} ${BENCH} all
153+ - ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all
176154
177155 # cabal check
178- - (cd stm-* && cabal check)
156+ - (cd stm-* && ${CABAL} check)
179157
180158 # haddock
181- - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
159+ - ${CABAL} new-haddock -w ${HC} ${TEST} ${BENCH} all
182160
183161 # Build without installed constraints for packages in global-db
184- - 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
162+ - rm -f cabal.project.local; ${CABAL} new-build -w ${HC} --disable-tests --disable-benchmarks all;
185163
186164# REGENDATA ["--output",".travis.yml","stm.cabal"]
187165# EOF
0 commit comments