hasql/.travis.yml
2021-03-24 10:25:05 +03:00

62 lines
1.5 KiB
YAML

if: tag IS blank
env:
- ghc=8.6.1
- ghc=8.8.1
- ghc=8.10.2 benchmarks=1 tests=1
- ghc=9.0.1
matrix:
allow_failures:
- env: ghc=9.0.1
services:
- postgresql
install:
# Set up the Shell to treat the semicolon as &&
- set -eo pipefail
# Install GHC and Cabal
-
cabal=${cabal=2.4};
travis_retry sudo add-apt-repository -y ppa:hvr/ghc;
travis_retry sudo apt-get update;
travis_retry sudo apt-get install cabal-install-$cabal ghc-$ghc;
export PATH=/opt/ghc/$ghc/bin:/opt/cabal/$cabal/bin:$PATH;
# Update the Cabal database
- cabal update
# Switch to the distro:
-
export pkg_name=$(cabal info . | awk '{print $2;exit}');
cabal sdist;
cd dist;
tar xzvf $pkg_name.tar.gz;
cd $pkg_name;
# Install the lower bound dependencies
-
if [ "$lower_bound_dependencies" = "1" ];
then
constraint_options=(
);
fi;
# Install the library dependencies
- cabal v1-install --only-dependencies --reorder-goals --force-reinstalls
${constraint_options[@]}
$([ "$tests" = "1" ] && echo "--enable-tests")
$([ "$benchmarks" = "1" ] && echo "--enable-benchmarks")
# Build the library
- cabal v1-build
# Configure and build the remaining stuff
- cabal v1-configure
$([ "$tests" = "1" ] && echo "--enable-tests")
$([ "$benchmarks" = "1" ] && echo "--enable-benchmarks")
-f doctest
- cabal v1-build
script:
- |
if [ "$tests" = "1" ];
then
cabal v1-test --show-details=always;
fi;