2017-10-22 11:59:10 +02:00
# This Travis job script has been generated by a script via
#
2019-02-11 14:52:42 +01:00
# haskell-ci '--config=cabal.haskell-ci' '--output=.travis.yml' 'cabal.project'
2017-10-22 11:59:10 +02:00
#
2018-09-19 12:27:43 +02:00
# For more information, see https://github.com/haskell-CI/haskell-ci
2017-10-22 11:59:10 +02:00
#
2019-03-06 11:39:18 +01:00
# version: 0.2.1
#
2017-10-22 11:59:10 +02:00
language : c
2019-02-06 20:18:24 +01:00
dist : xenial
2017-10-22 11:59:10 +02:00
git :
submodules : false # whether to recursively clone submodules
2017-11-10 22:29:48 +01:00
branches :
only :
2017-12-10 12:29:37 +01:00
- master
2017-11-10 22:29:48 +01:00
2017-10-22 11:59:10 +02:00
cache :
directories :
- $HOME/.cabal/packages
- $HOME/.cabal/store
before_cache :
2019-02-25 21:37:04 +01:00
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
2017-10-22 11:59:10 +02:00
# remove files that are regenerated by 'cabal update'
2019-02-25 21:37:04 +01:00
- rm -fv $CABALHOME/packages/hackage.haskell.org/00-index.*
- rm -fv $CABALHOME/packages/hackage.haskell.org/*.json
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.cache
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar
- rm -fv $CABALHOME/packages/hackage.haskell.org/01-index.tar.idx
2015-09-24 08:40:27 +02:00
2019-02-25 21:37:04 +01:00
- rm -rfv $CABALHOME/packages/head.hackage
2018-01-05 09:33:10 +01:00
2017-10-22 11:59:10 +02:00
matrix :
include :
2019-03-06 11:39:18 +01:00
- compiler : "ghc-8.6.4"
addons : {apt : {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.6.4], sources : [ hvr-ghc]}}
2018-10-15 17:15:52 +02:00
- compiler : "ghc-8.4.4"
addons : {apt : {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.4.4], sources : [ hvr-ghc]}}
2018-03-15 09:46:30 +01:00
- compiler : "ghc-8.2.2"
2018-10-04 12:04:00 +02:00
addons : {apt : {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.2.2], sources : [ hvr-ghc]}}
2017-10-22 11:59:10 +02:00
- compiler : "ghc-8.0.2"
2018-10-04 12:04:00 +02:00
addons : {apt : {packages: [ghc-ppa-tools,cabal-install-2.4,ghc-8.0.2], sources : [ hvr-ghc]}}
2015-09-24 08:40:27 +02:00
2017-10-22 11:59:10 +02:00
before_install :
2019-02-25 21:37:04 +01:00
- HC=/opt/ghc/bin/${CC}
2017-10-22 11:59:10 +02:00
- HCPKG=${HC/ghc/ghc-pkg}
- unset CC
2019-02-25 21:37:04 +01:00
- CABAL=/opt/ghc/bin/cabal
- CABALHOME=$HOME/.cabal
2019-02-28 09:53:24 +01:00
- export PATH="$CABALHOME/bin:$PATH"
2017-12-10 12:29:37 +01:00
- ROOTDIR=$(pwd)
2018-01-05 09:33:10 +01:00
- HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
- echo $HCNUMVER
2015-04-20 19:52:29 +02:00
2015-04-20 13:38:25 +02:00
install :
2019-02-25 21:37:04 +01:00
- ${CABAL} --version
2017-10-22 11:59:10 +02:00
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
2019-02-25 21:37:04 +01:00
- TEST=--enable-tests
- BENCH=--enable-benchmarks
2018-01-05 09:33:10 +01:00
- GHCHEAD=${GHCHEAD-false}
2019-02-25 21:37:04 +01:00
- travis_retry ${CABAL} update -v
2019-02-28 09:53:24 +01:00
- sed -i.bak 's/^jobs:/-- jobs:/' $CABALHOME/config
2018-01-05 09:33:10 +01:00
- rm -fv cabal.project cabal.project.local
2019-02-25 21:37:04 +01:00
- "sed -i.bak 's/-- ghc-options:.*/ghc-options: -j2/' $CABALHOME/config"
- grep -Ev -- '^\s*--' $CABALHOME/config | grep -Ev '^\s*$'
2019-02-12 00:26:40 +01:00
- rm -f cabal.project
- touch cabal.project
- "printf 'packages: \"servant\"\\n' >> cabal.project"
- "printf 'packages: \"servant-client\"\\n' >> cabal.project"
- "printf 'packages: \"servant-client-core\"\\n' >> cabal.project"
- "printf 'packages: \"servant-http-streams\"\\n' >> cabal.project"
- "printf 'packages: \"servant-docs\"\\n' >> cabal.project"
- "printf 'packages: \"servant-foreign\"\\n' >> cabal.project"
- "printf 'packages: \"servant-server\"\\n' >> cabal.project"
- "printf 'packages: \"doc/tutorial\"\\n' >> cabal.project"
- "printf 'packages: \"servant-machines\"\\n' >> cabal.project"
- "printf 'packages: \"servant-conduit\"\\n' >> cabal.project"
- "printf 'packages: \"servant-pipes\"\\n' >> cabal.project"
2019-03-06 11:39:18 +01:00
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/basic-auth\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/curl-mock\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/basic-streaming\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/db-postgres-pool\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/db-sqlite-simple\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/file-upload\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/generic\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/https\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/pagination\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/testing\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/structuring-apis\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/using-custom-monad\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"doc/cookbook/using-free-client\"\\n' >> cabal.project ; fi"
2019-02-11 14:52:42 +01:00
- "echo 'constraints: foundation >=0.0.14' >> cabal.project"
- "echo 'constraints: memory <0.14.12 || >0.14.12' >> cabal.project"
- "echo 'allow-newer: servant-quickcheck:servant' >> cabal.project"
- "echo 'allow-newer: servant-quickcheck:servant-client' >> cabal.project"
- "echo 'allow-newer: servant-quickcheck:servant-server' >> cabal.project"
- "echo 'allow-newer: servant-quickcheck:hspec' >> cabal.project"
- "echo 'allow-newer: servant-quickcheck:http-client' >> cabal.project"
- "echo 'optimization: False' >> cabal.project "
2019-02-25 21:37:04 +01:00
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
2018-06-18 14:42:16 +02:00
- touch cabal.project.local
2019-02-28 09:53:24 +01:00
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(cookbook-basic-auth|cookbook-basic-streaming|cookbook-curl-mock|cookbook-db-postgres-pool|cookbook-db-sqlite-simple|cookbook-file-upload|cookbook-generic|cookbook-https|cookbook-pagination|cookbook-structuring-apis|cookbook-testing|cookbook-using-custom-monad|cookbook-using-free-client|servant|servant-client|servant-client-core|servant-conduit|servant-docs|servant-foreign|servant-http-streams|servant-machines|servant-pipes|servant-server|tutorial)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
2018-06-18 14:42:16 +02:00
- cat cabal.project || true
- cat cabal.project.local || true
2019-02-12 00:26:40 +01:00
- if [ -f "servant/configure.ac" ]; then (cd "servant" && autoreconf -i); fi
- if [ -f "servant-client/configure.ac" ]; then (cd "servant-client" && autoreconf -i); fi
- if [ -f "servant-client-core/configure.ac" ]; then (cd "servant-client-core" && autoreconf -i); fi
- if [ -f "servant-http-streams/configure.ac" ]; then (cd "servant-http-streams" && autoreconf -i); fi
- if [ -f "servant-docs/configure.ac" ]; then (cd "servant-docs" && autoreconf -i); fi
- if [ -f "servant-foreign/configure.ac" ]; then (cd "servant-foreign" && autoreconf -i); fi
- if [ -f "servant-server/configure.ac" ]; then (cd "servant-server" && autoreconf -i); fi
- if [ -f "doc/tutorial/configure.ac" ]; then (cd "doc/tutorial" && autoreconf -i); fi
- if [ -f "servant-machines/configure.ac" ]; then (cd "servant-machines" && autoreconf -i); fi
- if [ -f "servant-conduit/configure.ac" ]; then (cd "servant-conduit" && autoreconf -i); fi
- if [ -f "servant-pipes/configure.ac" ]; then (cd "servant-pipes" && autoreconf -i); fi
- if [ -f "doc/cookbook/basic-auth/configure.ac" ]; then (cd "doc/cookbook/basic-auth" && autoreconf -i); fi
- if [ -f "doc/cookbook/curl-mock/configure.ac" ]; then (cd "doc/cookbook/curl-mock" && autoreconf -i); fi
- if [ -f "doc/cookbook/basic-streaming/configure.ac" ]; then (cd "doc/cookbook/basic-streaming" && autoreconf -i); fi
- if [ -f "doc/cookbook/db-postgres-pool/configure.ac" ]; then (cd "doc/cookbook/db-postgres-pool" && autoreconf -i); fi
- if [ -f "doc/cookbook/db-sqlite-simple/configure.ac" ]; then (cd "doc/cookbook/db-sqlite-simple" && autoreconf -i); fi
- if [ -f "doc/cookbook/file-upload/configure.ac" ]; then (cd "doc/cookbook/file-upload" && autoreconf -i); fi
- if [ -f "doc/cookbook/generic/configure.ac" ]; then (cd "doc/cookbook/generic" && autoreconf -i); fi
- if [ -f "doc/cookbook/https/configure.ac" ]; then (cd "doc/cookbook/https" && autoreconf -i); fi
2019-02-28 09:53:24 +01:00
- if [ -f "doc/cookbook/pagination/configure.ac" ]; then (cd "doc/cookbook/pagination" && autoreconf -i); fi
2019-02-12 00:26:40 +01:00
- if [ -f "doc/cookbook/testing/configure.ac" ]; then (cd "doc/cookbook/testing" && autoreconf -i); fi
- if [ -f "doc/cookbook/structuring-apis/configure.ac" ]; then (cd "doc/cookbook/structuring-apis" && autoreconf -i); fi
- if [ -f "doc/cookbook/using-custom-monad/configure.ac" ]; then (cd "doc/cookbook/using-custom-monad" && autoreconf -i); fi
- if [ -f "doc/cookbook/using-free-client/configure.ac" ]; then (cd "doc/cookbook/using-free-client" && autoreconf -i); fi
2017-10-22 11:59:10 +02:00
- rm -f cabal.project.freeze
2019-02-28 09:53:24 +01:00
- rm -rf .ghc.environment.* "servant"/dist "servant-client"/dist "servant-client-core"/dist "servant-http-streams"/dist "servant-docs"/dist "servant-foreign"/dist "servant-server"/dist "doc/tutorial"/dist "servant-machines"/dist "servant-conduit"/dist "servant-pipes"/dist "doc/cookbook/basic-auth"/dist "doc/cookbook/curl-mock"/dist "doc/cookbook/basic-streaming"/dist "doc/cookbook/db-postgres-pool"/dist "doc/cookbook/db-sqlite-simple"/dist "doc/cookbook/file-upload"/dist "doc/cookbook/generic"/dist "doc/cookbook/https"/dist "doc/cookbook/pagination"/dist "doc/cookbook/testing"/dist "doc/cookbook/structuring-apis"/dist "doc/cookbook/using-custom-monad"/dist "doc/cookbook/using-free-client"/dist
2017-10-22 11:59:10 +02:00
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
2015-04-20 13:38:25 +02:00
2017-10-22 11:59:10 +02:00
# Here starts the actual work to be performed for the package under test;
# any command which exits with a non-zero exit code causes the build to fail.
2015-01-29 01:18:16 +01:00
script :
2017-10-22 11:59:10 +02:00
# test that source-distributions can be generated
2019-02-28 09:53:24 +01:00
- echo Packaging... && echo -en 'travis_fold:start:sdist\\r'
2019-02-25 21:37:04 +01:00
- ${CABAL} new-sdist all
2019-02-28 09:53:24 +01:00
- echo -en 'travis_fold:end:sdist\\r'
- echo Unpacking... && echo -en 'travis_fold:start:unpack\\r'
2018-10-15 17:15:52 +02:00
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
2017-12-10 12:29:37 +01:00
- cd ${DISTDIR} || false
2017-10-22 11:59:10 +02:00
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
2019-02-12 00:26:40 +01:00
- rm -f cabal.project
- touch cabal.project
- "printf 'packages: \"servant-*/*.cabal\"\\n' >> cabal.project"
- "printf 'packages: \"servant-client-*/*.cabal\"\\n' >> cabal.project"
- "printf 'packages: \"servant-client-core-*/*.cabal\"\\n' >> cabal.project"
- "printf 'packages: \"servant-http-streams-*/*.cabal\"\\n' >> cabal.project"
- "printf 'packages: \"servant-docs-*/*.cabal\"\\n' >> cabal.project"
- "printf 'packages: \"servant-foreign-*/*.cabal\"\\n' >> cabal.project"
- "printf 'packages: \"servant-server-*/*.cabal\"\\n' >> cabal.project"
- "printf 'packages: \"tutorial-*/*.cabal\"\\n' >> cabal.project"
- "printf 'packages: \"servant-machines-*/*.cabal\"\\n' >> cabal.project"
- "printf 'packages: \"servant-conduit-*/*.cabal\"\\n' >> cabal.project"
- "printf 'packages: \"servant-pipes-*/*.cabal\"\\n' >> cabal.project"
2019-03-06 11:39:18 +01:00
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-basic-auth-*/*.cabal\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-curl-mock-*/*.cabal\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-basic-streaming-*/*.cabal\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-db-postgres-pool-*/*.cabal\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-db-sqlite-simple-*/*.cabal\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-file-upload-*/*.cabal\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-generic-*/*.cabal\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-https-*/*.cabal\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-pagination-*/*.cabal\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-testing-*/*.cabal\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-structuring-apis-*/*.cabal\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-using-custom-monad-*/*.cabal\"\\n' >> cabal.project ; fi"
- "if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then printf 'packages: \"cookbook-using-free-client-*/*.cabal\"\\n' >> cabal.project ; fi"
2019-02-11 14:52:42 +01:00
- "echo 'constraints: foundation >=0.0.14' >> cabal.project"
- "echo 'constraints: memory <0.14.12 || >0.14.12' >> cabal.project"
- "echo 'allow-newer: servant-quickcheck:servant' >> cabal.project"
- "echo 'allow-newer: servant-quickcheck:servant-client' >> cabal.project"
- "echo 'allow-newer: servant-quickcheck:servant-server' >> cabal.project"
- "echo 'allow-newer: servant-quickcheck:hspec' >> cabal.project"
- "echo 'allow-newer: servant-quickcheck:http-client' >> cabal.project"
- "echo 'optimization: False' >> cabal.project "
2019-02-25 21:37:04 +01:00
- "printf 'write-ghc-environment-files: always\\n' >> cabal.project"
2018-06-18 14:42:16 +02:00
- touch cabal.project.local
2019-02-28 09:53:24 +01:00
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | grep -vE -- '^(cookbook-basic-auth|cookbook-basic-streaming|cookbook-curl-mock|cookbook-db-postgres-pool|cookbook-db-sqlite-simple|cookbook-file-upload|cookbook-generic|cookbook-https|cookbook-pagination|cookbook-structuring-apis|cookbook-testing|cookbook-using-custom-monad|cookbook-using-free-client|servant|servant-client|servant-client-core|servant-conduit|servant-docs|servant-foreign|servant-http-streams|servant-machines|servant-pipes|servant-server|tutorial)$' | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
2018-06-18 14:42:16 +02:00
- cat cabal.project || true
- cat cabal.project.local || true
2019-02-28 09:53:24 +01:00
- echo -en 'travis_fold:end:unpack\\r'
2015-02-19 20:32:05 +01:00
2019-02-28 09:53:24 +01:00
- echo Building with tests and benchmarks... && echo -en 'travis_fold:start:build-everything\\r'
2017-10-22 11:59:10 +02:00
# build & run tests, build benchmarks
2019-02-25 21:37:04 +01:00
- ${CABAL} new-build -w ${HC} ${TEST} ${BENCH} all
2019-02-28 09:53:24 +01:00
- echo -en 'travis_fold:end:build-everything\\r'
2019-02-25 21:37:04 +01:00
- if [ "x$TEST" = "x--enable-tests" ]; then ${CABAL} new-test -w ${HC} ${TEST} ${BENCH} all; fi
2017-10-22 11:59:10 +02:00
2019-02-28 09:53:24 +01:00
- echo Haddock... && echo -en 'travis_fold:start:haddock\\r'
2018-03-15 09:46:30 +01:00
# haddock
2019-02-25 21:37:04 +01:00
- ${CABAL} new-haddock -w ${HC} ${TEST} ${BENCH} all
2017-10-22 11:59:10 +02:00
2019-02-28 09:53:24 +01:00
- echo -en 'travis_fold:end:haddock\\r'
2019-02-11 14:52:42 +01:00
# REGENDATA ["--config=cabal.haskell-ci","--output=.travis.yml","cabal.project"]
2017-10-22 11:59:10 +02:00
# EOF