2017-10-22 11:59:10 +02:00
# This Travis job script has been generated by a script via
#
2018-03-15 09:46:30 +01:00
# runghc make_travis_yml_2.hs '--config=cabal.make-travis-yml' '--output=.travis.yml' 'cabal.project'
2017-10-22 11:59:10 +02:00
#
# For more information, see https://github.com/hvr/multi-ghc-travis
#
language : c
2015-09-06 06:39:40 +02:00
sudo : false
2014-12-02 17:24:10 +01:00
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 :
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
# remove files that are regenerated by 'cabal update'
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
2015-09-24 08:40:27 +02:00
2018-01-17 17:53:02 +01:00
- rm -rfv $HOME/.cabal/packages/head.hackage
2018-01-05 09:33:10 +01:00
2017-10-22 11:59:10 +02:00
matrix :
include :
2018-06-01 12:42:34 +02:00
- compiler : "ghc-8.4.3"
2017-10-22 11:59:10 +02:00
# env: TEST=--disable-tests BENCH=--disable-benchmarks
2018-06-09 09:15:48 +02:00
addons : {apt : {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.4.3], sources : [ hvr-ghc]}}
2018-03-15 09:46:30 +01:00
- compiler : "ghc-8.2.2"
2017-10-22 11:59:10 +02:00
# env: TEST=--disable-tests BENCH=--disable-benchmarks
2018-06-09 09:15:48 +02:00
addons : {apt : {packages: [ghc-ppa-tools,cabal-install-2.2,ghc-8.2.2], sources : [ hvr-ghc]}}
2017-10-22 11:59:10 +02:00
- compiler : "ghc-8.0.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
2018-06-09 09:15:48 +02:00
addons : {apt : {packages: [ghc-ppa-tools,cabal-install-2.2,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 :
- HC=${CC}
- HCPKG=${HC/ghc/ghc-pkg}
- unset CC
2017-12-10 12:29:37 +01:00
- ROOTDIR=$(pwd)
2018-01-05 09:33:10 +01:00
- mkdir -p $HOME/.local/bin
- "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
- 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 :
2017-10-22 11:59:10 +02:00
- cabal --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
- BENCH=${BENCH---enable-benchmarks}
- TEST=${TEST---enable-tests}
- HADDOCK=${HADDOCK-true}
2018-06-18 14:42:16 +02:00
- UNCONSTRAINED=${UNCONSTRAINED-true}
- NOINSTALLEDCONSTRAINTS=${NOINSTALLEDCONSTRAINTS-false}
2018-01-05 09:33:10 +01:00
- GHCHEAD=${GHCHEAD-false}
2017-10-22 11:59:10 +02:00
- travis_retry cabal update -v
2017-12-10 12:29:37 +01:00
- "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
2018-01-05 09:33:10 +01:00
- rm -fv cabal.project cabal.project.local
- "if [ $HCNUMVER -ge 70800 ]; then sed -i.bak 's/-- ghc-options:.*/ghc-options: -j2/' ${HOME}/.cabal/config; fi"
- grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
2018-09-14 19:01:04 +02:00
- "printf 'packages: \"servant\" \"servant-client\" \"servant-client-core\" \"servant-docs\" \"servant-foreign\" \"servant-server\" \"doc/tutorial\" \"doc/cookbook/basic-auth\" \"doc/cookbook/curl-mock\" \"doc/cookbook/db-postgres-pool\" \"doc/cookbook/db-sqlite-simple\" \"doc/cookbook/file-upload\" \"doc/cookbook/generic\" \"doc/cookbook/https\" \"doc/cookbook/jwt-and-basic-auth\" \"doc/cookbook/pagination\" \"doc/cookbook/structuring-apis\" \"doc/cookbook/using-custom-monad\" \"doc/cookbook/using-free-client\"\\n' > cabal.project"
2018-01-17 17:53:02 +01:00
- "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project"
2018-06-19 17:52:02 +02:00
- "echo 'allow-newer: servant-auth-server:http-types,servant-auth-server:servant-server, servant-pagination:servant,servant-pagination:servant-server' >> cabal.project"
2018-06-18 14:42:16 +02:00
- touch cabal.project.local
2018-09-14 19:01:04 +02:00
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- servant | grep -vw -- servant-client | grep -vw -- servant-client-core | grep -vw -- servant-docs | grep -vw -- servant-foreign | grep -vw -- servant-server | grep -vw -- tutorial | grep -vw -- cookbook-basic-auth | grep -vw -- cookbook-curl-mock | grep -vw -- cookbook-db-postgres-pool | grep -vw -- cookbook-db-sqlite-simple | grep -vw -- cookbook-file-upload | grep -vw -- cookbook-generic | grep -vw -- cookbook-https | grep -vw -- cookbook-jwt-and-basic-auth | grep -vw -- cookbook-pagination | grep -vw -- cookbook-structuring-apis | grep -vw -- cookbook-using-custom-monad | grep -vw -- cookbook-using-free-client | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
2018-06-18 14:42:16 +02:00
- cat cabal.project || true
- cat cabal.project.local || true
2017-10-22 11:59:10 +02:00
- if [ -f "servant/configure.ac" ]; then
2018-01-05 09:33:10 +01:00
(cd "servant" && autoreconf -i);
2017-10-22 11:59:10 +02:00
fi
- if [ -f "servant-client/configure.ac" ]; then
2018-01-05 09:33:10 +01:00
(cd "servant-client" && autoreconf -i);
2017-10-22 11:59:10 +02:00
fi
- if [ -f "servant-client-core/configure.ac" ]; then
2018-01-05 09:33:10 +01:00
(cd "servant-client-core" && autoreconf -i);
2017-10-22 11:59:10 +02:00
fi
- if [ -f "servant-docs/configure.ac" ]; then
2018-01-05 09:33:10 +01:00
(cd "servant-docs" && autoreconf -i);
2017-10-22 11:59:10 +02:00
fi
- if [ -f "servant-foreign/configure.ac" ]; then
2018-01-05 09:33:10 +01:00
(cd "servant-foreign" && autoreconf -i);
2017-10-22 11:59:10 +02:00
fi
- if [ -f "servant-server/configure.ac" ]; then
2018-01-05 09:33:10 +01:00
(cd "servant-server" && autoreconf -i);
2017-10-22 11:59:10 +02:00
fi
- if [ -f "doc/tutorial/configure.ac" ]; then
2018-01-05 09:33:10 +01:00
(cd "doc/tutorial" && autoreconf -i);
2017-10-22 11:59:10 +02:00
fi
2018-03-15 09:46:30 +01:00
- if [ -f "doc/cookbook/basic-auth/configure.ac" ]; then
(cd "doc/cookbook/basic-auth" && autoreconf -i);
fi
2018-09-14 19:01:04 +02:00
- if [ -f "doc/cookbook/curl-mock/configure.ac" ]; then
(cd "doc/cookbook/curl-mock" && autoreconf -i);
fi
2018-01-17 20:43:00 +01:00
- 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
2018-06-19 17:52:02 +02:00
- if [ -f "doc/cookbook/file-upload/configure.ac" ]; then
(cd "doc/cookbook/file-upload" && autoreconf -i);
fi
2018-07-05 23:21:17 +02:00
- if [ -f "doc/cookbook/generic/configure.ac" ]; then
(cd "doc/cookbook/generic" && autoreconf -i);
fi
2018-01-17 20:43:00 +01:00
- if [ -f "doc/cookbook/https/configure.ac" ]; then
(cd "doc/cookbook/https" && autoreconf -i);
fi
2018-06-19 17:52:02 +02:00
- if [ -f "doc/cookbook/jwt-and-basic-auth/configure.ac" ]; then
(cd "doc/cookbook/jwt-and-basic-auth" && autoreconf -i);
fi
2018-03-15 09:46:30 +01:00
- if [ -f "doc/cookbook/pagination/configure.ac" ]; then
(cd "doc/cookbook/pagination" && autoreconf -i);
fi
2018-01-17 20:43:00 +01:00
- 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
2018-07-05 23:21:17 +02:00
- 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
2018-09-14 19:01:04 +02:00
- rm -rf .ghc.environment.* "servant"/dist "servant-client"/dist "servant-client-core"/dist "servant-docs"/dist "servant-foreign"/dist "servant-server"/dist "doc/tutorial"/dist "doc/cookbook/curl-mock"/dist "doc/cookbook/basic-auth"/dist "doc/cookbook/curl-mock"/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/jwt-and-basic-auth"/dist "doc/cookbook/pagination"/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
- echo Packaging... && echo -en 'travis_fold:start:sdist\\r'
2017-12-10 12:29:37 +01:00
- (cd "servant" && cabal sdist)
- (cd "servant-client" && cabal sdist)
- (cd "servant-client-core" && cabal sdist)
- (cd "servant-docs" && cabal sdist)
- (cd "servant-foreign" && cabal sdist)
- (cd "servant-server" && cabal sdist)
- (cd "doc/tutorial" && cabal sdist)
2018-03-15 09:46:30 +01:00
- (cd "doc/cookbook/basic-auth" && cabal sdist)
2018-09-14 19:01:04 +02:00
- (cd "doc/cookbook/curl-mock" && cabal sdist)
2018-01-17 20:43:00 +01:00
- (cd "doc/cookbook/db-postgres-pool" && cabal sdist)
- (cd "doc/cookbook/db-sqlite-simple" && cabal sdist)
2018-06-19 17:52:02 +02:00
- (cd "doc/cookbook/file-upload" && cabal sdist)
2018-07-05 23:21:17 +02:00
- (cd "doc/cookbook/generic" && cabal sdist)
2018-01-17 20:43:00 +01:00
- (cd "doc/cookbook/https" && cabal sdist)
2018-06-19 17:52:02 +02:00
- (cd "doc/cookbook/jwt-and-basic-auth" && cabal sdist)
2018-03-15 09:46:30 +01:00
- (cd "doc/cookbook/pagination" && cabal sdist)
2018-01-17 20:43:00 +01:00
- (cd "doc/cookbook/structuring-apis" && cabal sdist)
- (cd "doc/cookbook/using-custom-monad" && cabal sdist)
2018-07-05 23:21:17 +02:00
- (cd "doc/cookbook/using-free-client" && cabal sdist)
2017-10-22 11:59:10 +02:00
- echo -en 'travis_fold:end:sdist\\r'
- echo Unpacking... && echo -en 'travis_fold:start:unpack\\r'
2018-09-14 19:01:04 +02:00
- mv "servant"/dist/servant-*.tar.gz "servant-client"/dist/servant-client-*.tar.gz "servant-client-core"/dist/servant-client-core-*.tar.gz "servant-docs"/dist/servant-docs-*.tar.gz "servant-foreign"/dist/servant-foreign-*.tar.gz "servant-server"/dist/servant-server-*.tar.gz "doc/tutorial"/dist/tutorial-*.tar.gz "doc/cookbook/basic-auth"/dist/cookbook-basic-auth-*.tar.gz "doc/cookbook/curl-mock"/dist/cookbook-curl-mock-*.tar.gz "doc/cookbook/db-postgres-pool"/dist/cookbook-db-postgres-pool-*.tar.gz "doc/cookbook/db-sqlite-simple"/dist/cookbook-db-sqlite-simple-*.tar.gz "doc/cookbook/file-upload"/dist/cookbook-file-upload-*.tar.gz "doc/cookbook/generic"/dist/cookbook-generic-*.tar.gz "doc/cookbook/https"/dist/cookbook-https-*.tar.gz "doc/cookbook/jwt-and-basic-auth"/dist/cookbook-jwt-and-basic-auth-*.tar.gz "doc/cookbook/pagination"/dist/cookbook-pagination-*.tar.gz "doc/cookbook/structuring-apis"/dist/cookbook-structuring-apis-*.tar.gz "doc/cookbook/using-custom-monad"/dist/cookbook-using-custom-monad-*.tar.gz "doc/cookbook/using-free-client"/dist/cookbook-using-free-client-*.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 '{}' \;
2018-09-14 19:01:04 +02:00
- "printf 'packages: servant-*/*.cabal servant-client-*/*.cabal servant-client-core-*/*.cabal servant-docs-*/*.cabal servant-foreign-*/*.cabal servant-server-*/*.cabal tutorial-*/*.cabal cookbook-basic-auth-*/*.cabal cookbook-curl-mock-*/*.cabal cookbook-db-postgres-pool-*/*.cabal cookbook-db-sqlite-simple-*/*.cabal cookbook-file-upload-*/*.cabal cookbook-generic-*/*.cabal cookbook-https-*/*.cabal cookbook-jwt-and-basic-auth-*/*.cabal cookbook-pagination-*/*.cabal cookbook-structuring-apis-*/*.cabal cookbook-using-custom-monad-*/*.cabal cookbook-using-free-client-*/*.cabal\\n' > cabal.project"
2018-01-17 17:53:02 +01:00
- "echo 'constraints: foundation >=0.0.14,memory <0.14.12 || >0.14.12' >> cabal.project"
2018-06-19 17:52:02 +02:00
- "echo 'allow-newer: servant-auth-server:http-types,servant-auth-server:servant-server, servant-pagination:servant,servant-pagination:servant-server' >> cabal.project"
2018-06-18 14:42:16 +02:00
- touch cabal.project.local
2018-09-14 19:01:04 +02:00
- "if ! $NOINSTALLEDCONSTRAINTS; then for pkg in $($HCPKG list --simple-output); do echo $pkg | grep -vw -- servant | grep -vw -- servant-client | grep -vw -- servant-client-core | grep -vw -- servant-docs | grep -vw -- servant-foreign | grep -vw -- servant-server | grep -vw -- tutorial | grep -vw -- cookbook-basic-auth | grep -vw -- cookbook-curl-mock | grep -vw -- cookbook-db-postgres-pool | grep -vw -- cookbook-db-sqlite-simple | grep -vw -- cookbook-file-upload | grep -vw -- cookbook-generic | grep -vw -- cookbook-https | grep -vw -- cookbook-jwt-and-basic-auth | grep -vw -- cookbook-pagination | grep -vw -- cookbook-structuring-apis | grep -vw -- cookbook-using-custom-monad | grep -vw -- cookbook-using-free-client | sed 's/^/constraints: /' | sed 's/-[^-]*$/ installed/' >> cabal.project.local; done; fi"
2018-06-18 14:42:16 +02:00
- cat cabal.project || true
- cat cabal.project.local || true
2017-10-22 11:59:10 +02:00
- echo -en 'travis_fold:end:unpack\\r'
2015-02-19 20:32:05 +01:00
2017-10-22 11:59:10 +02:00
- echo Building with tests and benchmarks... && echo -en 'travis_fold:start:build-everything\\r'
# build & run tests, build benchmarks
2018-03-15 09:46:30 +01:00
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
2017-10-22 11:59:10 +02:00
- echo -en 'travis_fold:end:build-everything\\r'
2018-03-15 09:46:30 +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
2018-03-15 09:46:30 +01:00
- echo Haddock... && echo -en 'travis_fold:start:haddock\\r'
# haddock
- rm -rf ./dist-newstyle
- if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
2017-10-22 11:59:10 +02:00
2018-03-15 09:46:30 +01:00
- echo -en 'travis_fold:end:haddock\\r'
2018-06-18 14:42:16 +02:00
- echo Building without installed constraints for packages in global-db... && echo -en 'travis_fold:start:build-installed\\r'
# Build without installed constraints for packages in global-db
- 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
- echo -en 'travis_fold:end:build-installed\\r'
2018-03-15 09:46:30 +01:00
# REGENDATA ["--config=cabal.make-travis-yml","--output=.travis.yml","cabal.project"]
2017-10-22 11:59:10 +02:00
# EOF