Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 42 additions & 58 deletions .azure/azure-linux-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,69 +24,43 @@ jobs:
maxParallel: 5
steps:
- script: |
echo $OS_NAME
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root;
echo $STACK_ROOT
mkdir -p ~/.local/bin
curl -f -L "https://github.com/fpco/cache-s3/releases/download/${CACHE_S3_VERSION}/cache-s3-${CACHE_S3_VERSION}-${OS_NAME}-x86_64.tar.gz" -o ~/.local/bin/cache-s3.tar.gz
tar xzf ~/.local/bin/cache-s3.tar.gz -C ~/.local/bin
export PATH=$HOME/.local/bin:$PATH;
cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" restore stack --base-branch="${BASE_BRANCH}"
cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" restore stack work --base-branch="${BASE_BRANCH}"
etc/scripts/ci-setup.sh
case "$BUILD" in
style)
export PATH="$(pwd)"/hlint:$PATH
;;
cabal)
export PATH=$HOME/.local/bin:$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/happy/1.19.5/bin:/opt/alex/3.1.7/bin:/opt/cabal/$CABALVER/bin:$PATH
;;
*)
export PATH=$HOME/.local/bin:/opt/ghc/$GHCVER/bin:/opt/happy/1.19.5/bin:/opt/alex/3.1.7/bin:$PATH
;;
esac
if ! [ "$BUILD" = style ]; then echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"; fi
set -ex
case "$BUILD" in
style)
./etc/scripts/get-hlint.sh
export PATH="$(pwd)"/hlint:$PATH
;;
cabal)
sudo add-apt-repository -y ppa:hvr/ghc
sudo apt-get update
sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
# See note here: https://github.com/haskell-CI/haskell-ci#alex--happy-with-ghc--78
if [ "$GHCVER" = "head" ] || [ "${GHCVER%.*}" = "7.8" ] || [ "${GHCVER%.*}" = "7.10" ]; then
sudo apt-get install happy-1.19.4 alex-3.1.3
export PATH=/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:$PATH
else
sudo apt-get install happy alex
fi
export PATH=$HOME/.local/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
cabal --version
cabal update
rm -f $HOME/.cabal/bin/stack
echo "stack is located at $(which stack)"
stack --version

echo Removing any old dist files
rm -f $(stack --stack-yaml=$STACK_YAML path --dist-dir)/stack-*.tar.gz

echo To avoid custom Cabal setup business, switching temporarily to Simple
cp stack.cabal stack.orig-cabal
sed 's@build-type\:.*@build-type\: Simple@' < stack.orig-cabal > stack.cabal

echo Generating new dist with pvp bounds in the cabal file
stack --system-ghc --stack-yaml=$STACK_YAML sdist --pvp-bounds=both

echo Grabbing the newly generated stack.cabal file from the tarball
tar xf $(stack --system-ghc --compiler=ghc-$GHCVER path --dist-dir)/stack-*.tar.gz --wildcards --strip-components=1 '*/stack.cabal'

echo Switching back to Custom build type
cp stack.cabal stack.orig-cabal
sed 's@build-type\:.*@build-type\: Custom@' < stack.orig-cabal > stack.cabal
rm -f stack.orig-cabal

echo Performing the actual build now that we have the right stack.cabal
cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1
PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
;;
*)
stack --no-terminal build Cabal
stack --no-terminal test --only-dependencies
export PATH=$HOME/.local/bin:$PATH
stack --install-ghc $ARGS test --bench --only-dependencies
;;
esac
set +ex
GHC_OPTIONS="-Werror"
if [ $GHCVER = 8.2.1 ]; then GHC_OPTIONS="$GHC_OPTIONS -Wno-missing-home-modules"; fi
if [ "$GHCVER" = "8.2.1" ]; then GHC_OPTIONS="$GHC_OPTIONS -Wno-missing-home-modules"; fi
set -ex
case "$BUILD" in
style)
Expand All @@ -95,25 +69,35 @@ jobs:
hlint test/ --cpp-simple
;;
stack)
stack --no-terminal test --haddock --no-haddock-deps --ghc-options="$GHC_OPTIONS"
stack test --haddock --no-haddock-deps --ghc-options="$GHC_OPTIONS"
;;
pedantic)
stack --system-ghc --no-terminal build --pedantic
stack --system-ghc build --pedantic
;;
cabal)
cabal configure --enable-tests --enable-benchmarks -v2 --ghc-options="-O0 $GHC_OPTIONS"
cabal build
cabal test
cabal check
cabal sdist
cabal copy
cd test/integration
true stack setup --compiler=ghc-$GHCVER
true stack test --compiler=ghc-$GHCVER
cd ../..
SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")
;;
cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES

ORIGDIR=$(pwd)
for dir in $PACKAGES
do
cd $dir
cabal check || [ "$CABALVER" == "1.16" ]
cabal sdist
PKGVER=$(cabal info . | awk '{print $2;exit}')
SRC_TGZ=$PKGVER.tar.gz
cd dist
tar zxfv "$SRC_TGZ"
cd "$PKGVER"
cabal configure --enable-tests --ghc-options -O0
cabal build
if [ "$CABALVER" = "1.16" ] || [ "$CABALVER" = "1.18" ]; then
cabal test
else
cabal test --show-details=streaming
fi
cd $ORIGDIR
done
;;
esac
set +ex
env:
Expand Down
4 changes: 0 additions & 4 deletions .azure/azure-nightly-template-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jobs:
cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" restore stack work --base-branch="${BASE_BRANCH}"
etc/scripts/ci-setup.sh
export PATH=$HOME/.local/bin:/opt/ghc/$GHCVER/bin:/opt/happy/1.19.5/bin:/opt/alex/3.1.7/bin:$PATH
if ! [ "$BUILD" = style ]; then echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"; fi
set -ex
stack --no-terminal install cabal-install
set +ex
env:
OS_NAME: ${{ parameters.os }}
AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
Expand Down
3 changes: 0 additions & 3 deletions .azure/azure-nightly-template-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:
etc/scripts/ci-setup.sh
brew install mercurial
export PATH=$HOME/.local/bin:/opt/ghc/$GHCVER/bin:/opt/happy/1.19.5/bin:/opt/alex/3.1.7/bin:$PATH
set -ex
stack --no-terminal install cabal-install
set +ex
env:
OS_NAME: ${{ parameters.os }}
displayName: 'Installation ${{parameters.os}}'
Expand Down
1 change: 0 additions & 1 deletion .azure/azure-nightly-template-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
curl -sSkL http://www.stackage.org/stack/windows-i386 -o /usr/bin/stack.zip
unzip -o /usr/bin/stack.zip -d /usr/bin/
stack setup
stack --no-terminal install cabal-install
stack --version
env:
OS_NAME: ${{ parameters.os }}
Expand Down
84 changes: 3 additions & 81 deletions .azure/azure-osx-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
export AWS_ACCESS_KEY_ID="$(AWS_ACCESS_KEY_ID)";
export AWS_SECRET_ACCESS_KEY="$(AWS_SECRET_ACCESS_KEY)";
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root;
echo $STACK_ROOT
mkdir -p ~/.local/bin
curl -f -L "https://github.com/fpco/cache-s3/releases/download/${CACHE_S3_VERSION}/cache-s3-${CACHE_S3_VERSION}-${OS_NAME}-x86_64.tar.gz" -o ~/.local/bin/cache-s3.tar.gz
tar xzf ~/.local/bin/cache-s3.tar.gz -C ~/.local/bin
Expand All @@ -24,87 +23,10 @@ jobs:
cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" restore stack work --base-branch="${BASE_BRANCH}"
etc/scripts/ci-setup.sh
brew install mercurial
case "$BUILD" in
style)
export PATH="$TRAVIS_BUILD_DIR"/hlint:$PATH
;;
cabal)
export PATH=$HOME/.local/bin:$HOME/.cabal/bin:/opt/ghc/$GHCVER/bin:/opt/happy/1.19.5/bin:/opt/alex/3.1.7/bin:/opt/cabal/$CABALVER/bin:$PATH
;;
*)
export PATH=$HOME/.local/bin:/opt/ghc/$GHCVER/bin:/opt/happy/1.19.5/bin:/opt/alex/3.1.7/bin:$PATH
;;
esac
if ! [ "$BUILD" = style ]; then echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"; fi
set -ex
case "$BUILD" in
style)
./etc/scripts/get-hlint.sh
;;
cabal)
cabal --version
cabal update
rm -f $HOME/.cabal/bin/stack
echo "stack is located at $(which stack)"
stack --version

echo Removing any old dist files
rm -f $(stack --stack-yaml=$STACK_YAML path --dist-dir)/stack-*.tar.gz

echo To avoid custom Cabal setup business, switching temporarily to Simple
cp stack.cabal stack.orig-cabal
sed 's@build-type\:.*@build-type\: Simple@' < stack.orig-cabal > stack.cabal

echo Generating new dist with pvp bounds in the cabal file
stack --system-ghc --stack-yaml=$STACK_YAML sdist --pvp-bounds=both

echo Grabbing the newly generated stack.cabal file from the tarball
tar xf $(stack --system-ghc --compiler=ghc-$GHCVER path --dist-dir)/stack-*.tar.gz --wildcards --strip-components=1 '*/stack.cabal'

echo Switching back to Custom build type
cp stack.cabal stack.orig-cabal
sed 's@build-type\:.*@build-type\: Custom@' < stack.orig-cabal > stack.cabal
rm -f stack.orig-cabal

echo Performing the actual build now that we have the right stack.cabal
cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1
;;
*)
stack --no-terminal build Cabal
stack --no-terminal test --only-dependencies
;;
esac
set +ex
GHC_OPTIONS="-Werror"
if [ $GHCVER = 8.2.1 ]; then GHC_OPTIONS="$GHC_OPTIONS -Wno-missing-home-modules"; fi
export PATH=$HOME/.local/bin:$PATH
set -ex
case "$BUILD" in
style)
hlint src/
hlint src/ --cpp-define=WINDOWS=1
hlint test/ --cpp-simple
;;
stack)
stack --no-terminal test --haddock --no-haddock-deps --ghc-options="$GHC_OPTIONS"
;;
pedantic)
stack --system-ghc --no-terminal build --pedantic
;;
cabal)
cabal configure --enable-tests --enable-benchmarks -v2 --ghc-options="-O0 $GHC_OPTIONS"
cabal build
cabal test
cabal check
cabal sdist
cabal copy
cd test/integration
true stack setup --compiler=ghc-$GHCVER
true stack test --compiler=ghc-$GHCVER
cd ../..
SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")
;;
esac
stack --install-ghc $ARGS test --bench --only-dependencies
stack $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps
set +ex
env:
OS_NAME: ${{ parameters.os }}
Expand Down
2 changes: 1 addition & 1 deletion .azure/azure-windows-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
curl -sSkL http://www.stackage.org/stack/windows-i386 -o /usr/bin/stack.zip
unzip -o /usr/bin/stack.zip -d /usr/bin/
stack setup
stack --no-terminal test --jobs 1
stack test --jobs 1
env:
OS_NAME: ${{ parameters.os }}
displayName: 'Installation ${{parameters.os}}'
Expand Down