Update distro tests to support newer Cabal

This commit is contained in:
Vidar Holen 2020-03-30 17:55:07 -07:00
parent 37e78141bd
commit 67f0dc4fd5
2 changed files with 27 additions and 18 deletions

View File

@ -11,21 +11,34 @@ command -v cabal ||
cabal update || cabal update ||
die "can't update" die "can't update"
cabal install --dependencies-only --enable-tests ||
if [ -e /etc/arch-release ]
then
# Arch has an unconventional packaging setup
flags=(--disable-library-vanilla --enable-shared --enable-executable-dynamic --ghc-options=-dynamic)
else
flags=()
fi
cabal install --dependencies-only --enable-tests "${flags[@]}" ||
cabal install --dependencies-only "${flags[@]}" ||
die "can't install dependencies" die "can't install dependencies"
cabal configure --enable-tests || cabal configure --enable-tests "${flags[@]}" ||
die "configure failed" die "configure failed"
cabal build || cabal build ||
die "build failed" die "build failed"
cabal test || cabal test ||
die "test failed" die "test failed"
dist/build/shellcheck/shellcheck - << 'EOF' || die "execution failed" sc="$(find . -name shellcheck -type f -perm -111)"
[ -x "$sc" ] || die "Can't find executable"
"$sc" - << 'EOF' || die "execution failed"
#!/bin/sh #!/bin/sh
echo "Hello World" echo "Hello World"
EOF EOF
dist/build/shellcheck/shellcheck - << 'EOF' && die "negative execution failed" "$sc" - << 'EOF' && die "negative execution failed"
#!/bin/sh #!/bin/sh
echo $1 echo $1
EOF EOF

View File

@ -17,13 +17,13 @@ and is still highly experimental.
Make sure you're plugged in and have screen/tmux in place, Make sure you're plugged in and have screen/tmux in place,
then re-run with $0 --run to continue. then re-run with $0 --run to continue.
Also note that 'dist' will be deleted. Also note that dist* will be deleted.
EOF EOF
exit 0 exit 0
} }
echo "Deleting 'dist'..." echo "Deleting 'dist' and 'dist-newstyle'..."
rm -rf dist rm -rf dist dist-newstyle
log=$(mktemp) || die "Can't create temp file" log=$(mktemp) || die "Can't create temp file"
date >> "$log" || die "Can't write to log" date >> "$log" || die "Can't write to log"
@ -61,20 +61,16 @@ done << EOF
debian:stable apt-get update && apt-get install -y cabal-install debian:stable apt-get update && apt-get install -y cabal-install
debian:testing apt-get update && apt-get install -y cabal-install debian:testing apt-get update && apt-get install -y cabal-install
ubuntu:latest apt-get update && apt-get install -y cabal-install ubuntu:latest apt-get update && apt-get install -y cabal-install
haskell:latest true
opensuse/leap:latest zypper install -y cabal-install ghc opensuse/leap:latest zypper install -y cabal-install ghc
fedora:latest dnf install -y cabal-install ghc-template-haskell-devel findutils
archlinux/base:latest pacman -S -y --noconfirm cabal-install ghc-static base-devel
# Other Ubuntu versions we want to support # Other versions we want to support
ubuntu:19.04 apt-get update && apt-get install -y cabal-install ubuntu:18.04 apt-get update && apt-get install -y cabal-install
ubuntu:18.10 apt-get update && apt-get install -y cabal-install
# Misc Haskell including current and latest Stack build # Misc Haskell including current and latest Stack build
ubuntu:18.10 set -e; apt-get update && apt-get install -y curl && curl -sSL https://get.haskellstack.org/ | sh -s - -f && cd /mnt && exec test/stacktest ubuntu:18.04 set -e; apt-get update && apt-get install -y curl && curl -sSL https://get.haskellstack.org/ | sh -s - -f && cd /mnt && exec test/stacktest
haskell:latest true
# Known to currently fail
centos:latest yum install -y epel-release && yum install -y cabal-install
fedora:latest dnf install -y cabal-install
archlinux/base:latest pacman -S -y --noconfirm cabal-install ghc-static base-devel
EOF EOF
exit "$final" exit "$final"