servant-ekg/.travis.yml

150 lines
7.3 KiB
YAML
Raw Normal View History

2019-02-09 18:50:52 +01:00
# This Travis job script has been generated by a script via
#
# haskell-ci '--output=.travis.yml' '--config=cabal.haskell-ci' 'cabal.project'
2019-02-09 18:50:52 +01:00
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
2020-01-23 22:35:38 +01:00
# version: 0.9.20200121
2019-05-30 12:24:52 +02:00
#
2020-01-23 22:35:38 +01:00
version: ~> 1.0
2019-02-09 18:50:52 +01:00
language: c
2020-01-23 22:35:38 +01:00
os: linux
2019-02-09 18:50:52 +01:00
dist: xenial
git:
2019-05-30 12:24:52 +02:00
# whether to recursively clone submodules
submodules: false
2019-02-09 18:50:52 +01:00
branches:
only:
- master
cache:
directories:
- $HOME/.cabal/packages
- $HOME/.cabal/store
2020-01-23 22:35:38 +01:00
- $HOME/.hlint
2019-02-09 18:50:52 +01:00
before_cache:
2019-02-27 19:55:46 +01:00
- rm -fv $CABALHOME/packages/hackage.haskell.org/build-reports.log
2019-02-09 18:50:52 +01:00
# remove files that are regenerated by 'cabal update'
2019-02-27 19:55:46 +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
2020-01-23 22:35:38 +01:00
jobs:
2019-02-09 18:50:52 +01:00
include:
2019-05-30 12:24:52 +02:00
- compiler: ghc-8.6.5
2020-01-23 22:35:38 +01:00
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.5","cabal-install-3.0"]}}
os: linux
2019-05-30 12:24:52 +02:00
- compiler: ghc-8.4.4
2020-01-23 22:35:38 +01:00
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.4.4","cabal-install-3.0"]}}
os: linux
2019-05-30 12:24:52 +02:00
- compiler: ghc-8.2.2
2020-01-23 22:35:38 +01:00
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.2.2","cabal-install-3.0"]}}
os: linux
2019-05-30 12:24:52 +02:00
- compiler: ghc-8.0.2
2020-01-23 22:35:38 +01:00
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.0.2","cabal-install-3.0"]}}
os: linux
2019-02-09 18:50:52 +01:00
before_install:
2019-05-30 12:24:52 +02:00
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
2020-01-23 22:35:38 +01:00
- WITHCOMPILER="-w $HC"
- HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')
2019-05-30 12:24:52 +02:00
- HCPKG="$HC-pkg"
2019-02-09 18:50:52 +01:00
- unset CC
2019-02-27 19:55:46 +01:00
- CABAL=/opt/ghc/bin/cabal
- CABALHOME=$HOME/.cabal
- export PATH="$CABALHOME/bin:$PATH"
2019-05-30 12:24:52 +02:00
- TOP=$(pwd)
2020-01-23 22:35:38 +01:00
- "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')"
2019-02-09 18:50:52 +01:00
- echo $HCNUMVER
2020-01-23 22:35:38 +01:00
- CABAL="$CABAL -vnormal+nowrap"
2019-05-30 12:24:52 +02:00
- set -o pipefail
2019-02-27 19:55:46 +01:00
- TEST=--enable-tests
- BENCH=--enable-benchmarks
2020-01-23 22:35:38 +01:00
- HEADHACKAGE=false
2019-05-30 12:24:52 +02:00
- rm -f $CABALHOME/config
- |
echo "verbose: normal +nowrap +markoutput" >> $CABALHOME/config
echo "remote-build-reporting: anonymous" >> $CABALHOME/config
2020-01-23 22:35:38 +01:00
echo "write-ghc-environment-files: always" >> $CABALHOME/config
2019-05-30 12:24:52 +02:00
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
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
2020-01-23 22:35:38 +01:00
install:
- ${CABAL} --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
- |
echo "program-default-options" >> $CABALHOME/config
echo " ghc-options: $GHCJOBS +RTS -M6G -RTS" >> $CABALHOME/config
2019-05-30 12:24:52 +02:00
- 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
2019-02-27 19:55:46 +01:00
- touch cabal.project
2019-05-30 12:24:52 +02:00
- |
2020-01-23 22:35:38 +01:00
echo "packages: ." >> cabal.project
2019-05-30 12:24:52 +02:00
- |
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-ekg)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
2019-02-09 18:50:52 +01:00
- cat cabal.project || true
- cat cabal.project.local || true
2019-02-27 19:55:46 +01:00
- if [ -f "./configure.ac" ]; then (cd "." && autoreconf -i); fi
2020-01-23 22:35:38 +01:00
- ${CABAL} v2-freeze $WITHCOMPILER ${TEST} ${BENCH}
2019-05-30 12:24:52 +02:00
- "cat cabal.project.freeze | sed -E 's/^(constraints: *| *)//' | sed 's/any.//'"
- rm cabal.project.freeze
2020-01-23 22:35:38 +01:00
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} --dep -j2 all
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --dep -j2 all
2019-02-09 18:50:52 +01:00
script:
2019-05-30 12:24:52 +02:00
- DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
# Packaging...
2020-01-23 22:35:38 +01:00
- ${CABAL} v2-sdist all
2019-05-30 12:24:52 +02:00
# Unpacking...
2019-02-09 18:50:52 +01:00
- mv dist-newstyle/sdist/*.tar.gz ${DISTDIR}/
- cd ${DISTDIR} || false
2020-01-23 22:35:38 +01:00
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec tar -xvf '{}' \;
- find . -maxdepth 1 -type f -name '*.tar.gz' -exec rm '{}' \;
- PKGDIR_servant_ekg="$(find . -maxdepth 1 -type d -regex '.*/servant-ekg-[0-9.]*')"
2019-05-30 12:24:52 +02:00
# Generate cabal.project
- rm -rf cabal.project cabal.project.local cabal.project.freeze
2019-02-27 19:55:46 +01:00
- touch cabal.project
2019-05-30 12:24:52 +02:00
- |
2020-01-23 22:35:38 +01:00
echo "packages: ${PKGDIR_servant_ekg}" >> cabal.project
2019-05-30 12:24:52 +02:00
- |
- "for pkg in $($HCPKG list --simple-output); do echo $pkg | sed 's/-[^-]*$//' | (grep -vE -- '^(servant-ekg)$' || true) | sed 's/^/constraints: /' | sed 's/$/ installed/' >> cabal.project.local; done"
2019-02-09 18:50:52 +01:00
- cat cabal.project || true
- cat cabal.project.local || true
2019-05-30 12:24:52 +02:00
# Building...
2019-02-09 18:50:52 +01:00
# this builds all libraries and executables (without tests/benchmarks)
2020-01-23 22:35:38 +01:00
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
2019-05-30 12:24:52 +02:00
# Building with tests and benchmarks...
2019-02-09 18:50:52 +01:00
# build & run tests, build benchmarks
2020-01-23 22:35:38 +01:00
- ${CABAL} v2-build $WITHCOMPILER ${TEST} ${BENCH} all
2019-05-30 12:24:52 +02:00
# Testing...
2020-01-23 22:35:38 +01:00
- ${CABAL} v2-test $WITHCOMPILER ${TEST} ${BENCH} all
2019-05-30 12:24:52 +02:00
# cabal check...
2020-01-23 22:35:38 +01:00
- (cd ${PKGDIR_servant_ekg} && ${CABAL} -vnormal check)
2019-05-30 12:24:52 +02:00
# haddock...
2020-01-23 22:35:38 +01:00
- ${CABAL} v2-haddock $WITHCOMPILER --with-haddock $HADDOCK ${TEST} ${BENCH} all
2019-05-30 12:24:52 +02:00
# Building without installed constraints for packages in global-db...
- rm -f cabal.project.local
2020-01-23 22:35:38 +01:00
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all
# Constraint sets
- rm -rf cabal.project.local
# Constraint set servant-0.15
2020-01-23 22:35:38 +01:00
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.15.*' all
# Constraint set servant-0.16
2020-01-23 22:35:38 +01:00
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.16.*' all
# Constraint set servant-0.17
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.17.*' all
2020-01-23 22:35:38 +01:00
# REGENDATA ("0.9.20200121",["--output=.travis.yml","--config=cabal.haskell-ci","cabal.project"])
2019-02-09 18:50:52 +01:00
# EOF