servant/.travis.yml

245 lines
17 KiB
YAML
Raw Normal View History

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
#
# version: 0.3.20190521
2019-03-06 11:39:18 +01:00
#
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:
2019-03-22 00:27:28 +01:00
# whether to recursively clone submodules
submodules: false
branches:
only:
2017-12-10 12:29:37 +01:00
- master
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
- rm -rfv $CABALHOME/packages/head.hackage
2017-10-22 11:59:10 +02:00
matrix:
include:
2019-03-22 00:27:28 +01:00
- compiler: ghc-8.6.4
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.6.4","cabal-install-2.4"]}}
- compiler: ghc-8.4.4
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.4.4","cabal-install-2.4"]}}
- compiler: ghc-8.2.2
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.2.2","cabal-install-2.4"]}}
- compiler: ghc-8.0.2
addons: {"apt":{"sources":["hvr-ghc"],"packages":["ghc-8.0.2","cabal-install-2.4"]}}
2017-10-22 11:59:10 +02:00
before_install:
2019-03-22 00:27:28 +01:00
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
- HCPKG="$HC-pkg"
2017-10-22 11:59:10 +02:00
- 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"
2019-03-22 00:27:28 +01:00
- TOP=$(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
2019-03-22 00:27:28 +01:00
- CABAL="$CABAL -vnormal+nowrap+markoutput"
- set -o pipefail
- |
echo 'function blue(s) { printf "\033[0;34m" s "\033[0m " }' >> .colorful.awk
echo 'BEGIN { state = "output"; }' >> .colorful.awk
echo '/^-----BEGIN CABAL OUTPUT-----$/ { state = "cabal" }' >> .colorful.awk
echo '/^-----END CABAL OUTPUT-----$/ { state = "output" }' >> .colorful.awk
echo '!/^(-----BEGIN CABAL OUTPUT-----|-----END CABAL OUTPUT-----)/ {' >> .colorful.awk
echo ' if (state == "cabal") {' >> .colorful.awk
echo ' print blue($0)' >> .colorful.awk
echo ' } else {' >> .colorful.awk
echo ' print $0' >> .colorful.awk
echo ' }' >> .colorful.awk
echo '}' >> .colorful.awk
- cat .colorful.awk
- |
color_cabal_output () {
awk -f $TOP/.colorful.awk
}
- echo text | color_cabal_output
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-03-22 00:27:28 +01:00
- rm -f $CABALHOME/config
- |
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
echo "remote-repo-cache: $CABALHOME/packages" >> $CABALHOME/config
echo "logs-dir: $CABALHOME/logs" >> $CABALHOME/config
echo "world-file: $CABALHOME/world" >> $CABALHOME/config
echo "extra-prog-path: $CABALHOME/bin" >> $CABALHOME/config
echo "symlink-bindir: $CABALHOME/bin" >> $CABALHOME/config
echo "installdir: $CABALHOME/bin" >> $CABALHOME/config
2019-03-22 00:27:28 +01:00
echo "build-summary: $CABALHOME/logs/build.log" >> $CABALHOME/config
echo "store-dir: $CABALHOME/store" >> $CABALHOME/config
echo "install-dirs user" >> $CABALHOME/config
echo " prefix: $CABALHOME" >> $CABALHOME/config
echo "repository hackage.haskell.org" >> $CABALHOME/config
echo " url: http://hackage.haskell.org/" >> $CABALHOME/config
- |
echo "program-default-options" >> $CABALHOME/config
echo " ghc-options: -j2" >> $CABALHOME/config
- cat $CABALHOME/config
- rm -fv cabal.project cabal.project.local cabal.project.freeze
- travis_retry ${CABAL} v2-update -v
# Generate cabal.project
- rm -rf cabal.project cabal.project.local cabal.project.freeze
- touch cabal.project
2019-03-22 00:27:28 +01:00
- |
echo 'packages: "servant"' >> cabal.project
echo 'packages: "servant-client"' >> cabal.project
echo 'packages: "servant-client-core"' >> cabal.project
echo 'packages: "servant-http-streams"' >> cabal.project
echo 'packages: "servant-docs"' >> cabal.project
echo 'packages: "servant-foreign"' >> cabal.project
echo 'packages: "servant-server"' >> cabal.project
echo 'packages: "doc/tutorial"' >> cabal.project
echo 'packages: "servant-machines"' >> cabal.project
echo 'packages: "servant-conduit"' >> cabal.project
echo 'packages: "servant-pipes"' >> cabal.project
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/basic-auth"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/curl-mock"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/basic-streaming"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/db-postgres-pool"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/db-sqlite-simple"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/file-upload"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/generic"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/https"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/pagination"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/testing"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/structuring-apis"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/using-custom-monad"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "doc/cookbook/using-free-client"' >> cabal.project ; fi
- |
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 "allow-newer: vault-0.3.1.2:hashable" >> cabal.project
echo "allow-newer: psqueues-0.2.7.1:hashable" >> cabal.project
echo "allow-newer: sqlite-simple-0.4.16.0:semigroups" >> cabal.project
echo "allow-newer: direct-sqlite-2.3.24:semigroups" >> cabal.project
echo "allow-newer: io-streams-1.5.1.0:network" >> cabal.project
echo "allow-newer: openssl-streams-1.2.2.0:network" >> cabal.project
2019-03-22 00:27:28 +01:00
echo "optimization: False" >> cabal.project
echo "write-ghc-environment-files: always" >> cabal.project
- "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)$' || true) | 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
- 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
- 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
2018-11-24 12:09:08 +01:00
- ${CABAL} v2-freeze -w ${HC} ${TEST} ${BENCH} | color_cabal_output
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
- rm cabal.project.freeze
2015-01-29 01:18:16 +01:00
script:
2019-03-22 00:27:28 +01:00
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
# Packaging...
- echo 'Packaging...' && echo -en 'travis_fold:start:sdist\\r'
- ${CABAL} v2-sdist all | color_cabal_output
2019-02-28 09:53:24 +01:00
- echo -en 'travis_fold:end:sdist\\r'
2019-03-22 00:27:28 +01:00
# Unpacking...
- 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-03-22 00:27:28 +01:00
# Generate cabal.project
- rm -rf cabal.project cabal.project.local cabal.project.freeze
- touch cabal.project
2019-03-22 00:27:28 +01:00
- |
echo 'packages: "servant-*/*.cabal"' >> cabal.project
echo 'packages: "servant-client-*/*.cabal"' >> cabal.project
echo 'packages: "servant-client-core-*/*.cabal"' >> cabal.project
echo 'packages: "servant-http-streams-*/*.cabal"' >> cabal.project
echo 'packages: "servant-docs-*/*.cabal"' >> cabal.project
echo 'packages: "servant-foreign-*/*.cabal"' >> cabal.project
echo 'packages: "servant-server-*/*.cabal"' >> cabal.project
echo 'packages: "tutorial-*/*.cabal"' >> cabal.project
echo 'packages: "servant-machines-*/*.cabal"' >> cabal.project
echo 'packages: "servant-conduit-*/*.cabal"' >> cabal.project
echo 'packages: "servant-pipes-*/*.cabal"' >> cabal.project
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-basic-auth-*/*.cabal"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-curl-mock-*/*.cabal"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-basic-streaming-*/*.cabal"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-db-postgres-pool-*/*.cabal"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-db-sqlite-simple-*/*.cabal"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-file-upload-*/*.cabal"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-generic-*/*.cabal"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-https-*/*.cabal"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-pagination-*/*.cabal"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-testing-*/*.cabal"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-structuring-apis-*/*.cabal"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-using-custom-monad-*/*.cabal"' >> cabal.project ; fi
if [ $HCNUMVER -eq 80404 ] || [ $HCNUMVER -eq 80604 ] ; then echo 'packages: "cookbook-using-free-client-*/*.cabal"' >> cabal.project ; fi
- |
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 "allow-newer: vault-0.3.1.2:hashable" >> cabal.project
echo "allow-newer: psqueues-0.2.7.1:hashable" >> cabal.project
echo "allow-newer: sqlite-simple-0.4.16.0:semigroups" >> cabal.project
echo "allow-newer: direct-sqlite-2.3.24:semigroups" >> cabal.project
echo "allow-newer: io-streams-1.5.1.0:network" >> cabal.project
echo "allow-newer: openssl-streams-1.2.2.0:network" >> cabal.project
2019-03-22 00:27:28 +01:00
echo "optimization: False" >> cabal.project
echo "write-ghc-environment-files: always" >> cabal.project
- "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)$' || true) | 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'
2019-03-22 00:27:28 +01:00
# Building with tests and benchmarks...
- 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-03-22 00:27:28 +01:00
- ${CABAL} v2-build -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
2019-02-28 09:53:24 +01:00
- echo -en 'travis_fold:end:build-everything\\r'
2019-03-22 00:27:28 +01:00
# Testing...
- ${CABAL} v2-test -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
# haddock...
- echo 'haddock...' && echo -en 'travis_fold:start:haddock\\r'
- ${CABAL} v2-haddock -w ${HC} ${TEST} ${BENCH} all | color_cabal_output
2019-02-28 09:53:24 +01:00
- echo -en 'travis_fold:end:haddock\\r'
2019-03-22 00:27:28 +01:00
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