servant/.travis.yml

136 lines
6.4 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
#
# make_travis_yml_2.hs '-f' '-o' '.travis.yml' 'cabal.project'
#
# 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
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
2017-10-22 11:59:10 +02:00
matrix:
include:
- compiler: "ghc-7.8.4"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.8.4], sources: [hvr-ghc]}}
- compiler: "ghc-7.10.3"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-7.10.3], sources: [hvr-ghc]}}
- compiler: "ghc-8.0.2"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
- compiler: "ghc-8.2.1"
# env: TEST=--disable-tests BENCH=--disable-benchmarks
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.1], 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
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
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}
- INSTALLED=${INSTALLED-true}
- travis_retry cabal update -v
- sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
- rm -fv cabal.project.local
- 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-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
- rm -f cabal.project.freeze
- cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 servant-server servant-client
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 servant-server servant-client
2017-10-22 11:59:10 +02:00
- rm -rf "servant"/.ghc.environment.* "servant-client"/.ghc.environment.* "servant-client-core"/.ghc.environment.* "servant-docs"/.ghc.environment.* "servant-foreign"/.ghc.environment.* "servant-server"/.ghc.environment.* "doc/tutorial"/.ghc.environment.* "servant"/dist "servant-client"/dist "servant-client-core"/dist "servant-docs"/dist "servant-foreign"/dist "servant-server"/dist "doc/tutorial"/dist
- 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'
- (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)
- echo -en 'travis_fold:end:sdist\\r'
- echo Unpacking... && echo -en 'travis_fold:start:unpack\\r'
- 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 ${DISTDIR}/
- cd ${DISTDIR}
- find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
- "printf 'packages: servant-*/*.cabal servant-client-*/*.cabal servant-client-core-*/*.cabal servant-docs-*/*.cabal servant-foreign-*/*.cabal servant-server-*/*.cabal tutorial-*/*.cabal\n' > cabal.project"
# Allow-newer and other cabal.project amendments
- "echo 'allow-newer: servant-js:servant, servant-js:servant-foreign' >> cabal.project"
2017-10-22 11:59:10 +02:00
- echo -en 'travis_fold:end:unpack\\r'
- echo Building... && echo -en 'travis_fold:start:build\\r'
# this builds all libraries and executables (without tests/benchmarks)
- cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
- echo -en 'travis_fold:end:build\\r'
2015-02-19 20:32:05 +01:00
2017-10-22 11:59:10 +02:00
- echo Building with installed constraints for package in global-db... && echo -en 'travis_fold:start:build-installed\\r'
# Build with installed constraints for packages in global-db
- if $INSTALLED; then
echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks $(${HCPKG} list --global --simple-output --names-only | sed 's/\([a-zA-Z0-9-]\{1,\}\) */--constraint="\1 installed" /g') all | sh;
else echo "Not building with installed constraints"; fi
- echo -en 'travis_fold:end:build-installed\\r'
- echo Building with tests and benchmarks... && echo -en 'travis_fold:start:build-everything\\r'
# build & run tests, build benchmarks
- cabal new-build -w ${HC} ${TEST} ${BENCH} all
- echo -en 'travis_fold:end:build-everything\\r'
- echo Testing... && echo -en 'travis_fold:start:test\\r'
- if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} all; fi
- echo -en 'travis_fold:end:test\\r'
- echo Haddock... && echo -en 'travis_fold:start:haddock\\r'
# haddock
- rm -rf ./dist-newstyle
- if $HADDOCK; then cabal new-haddock -w ${HC} --disable-tests --disable-benchmarks all; else echo "Skipping haddock generation";fi
- echo -en 'travis_fold:end:haddock\\r'
# REGENDATA ["-f","-o",".travis.yml","cabal.project"]
# EOF