haskell-ide-engine/.azure/windows-cabal.yml

129 lines
5.0 KiB
YAML

jobs:
- job: Windows_Cabal
timeoutInMinutes: 0
pool:
vmImage: windows-2019
strategy:
matrix:
# It still is not in chocolatey
# ghc-8.8.2:
# GHC_VERSION: "8.8.2"
ghc-8.6.5:
GHC_VERSION: "8.6.5"
ghc-8.4.4:
GHC_VERSION: "8.4.4"
variables:
CABAL_VERSION: "3.0.0.0"
CABAL_STORE_DIR: "D:\\sd"
LIQUID_VERSION: "0.8.6.2"
STACK_ROOT: "D:\\sr"
steps:
- task: Cache@2
inputs:
key: '"cabal" | "$(Agent.OS)" | "$(CABAL_VERSION)" | "$(GHC_VERSION)" | $(Build.SourcesDirectory)/cabal.project | $(Build.SourcesDirectory)/haskell-ide-engine.cabal | $(Build.SourcesDirectory)/hie-plugin-api/hie-plugin-api.cabal'
path: .azure-cache
cacheHitVar: CACHE_RESTORED
displayName: "Download cache"
- bash: |
df -k
source .azure/windows-cabal.bashrc
mkdir -p $CABAL_ROOT
tar -vxzf .azure-cache/cabal-root.tar.gz -C /c
mkdir -p $CABAL_STORE_DIR
tar -vxzf .azure-cache/cabal-store.tar.gz -C /d
mkdir -p ${CABAL_STORE_DIR}i
tar -vxzf .azure-cache/cabal-store-install.tar.gz -C /d
mkdir -p dist-newstyle
tar -vxzf .azure-cache/cabal-dist.tar.gz
displayName: "Unpack cache"
condition: eq(variables.CACHE_RESTORED, 'true')
- bash: |
git submodule sync
git submodule update --init
displayName: Sync submodules
- bash: |
choco install -y --ignore-dependencies ghc --version=$GHC_VERSION
displayName: Install ghc
- bash: |
choco install -y cabal --version=$CABAL_VERSION
$(cygpath $ProgramData)/chocolatey/bin/RefreshEnv.cmd
displayName: Install cabal
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-update
echo "store-dir: $CABAL_STORE_DIR" >> $CABAL_ROOT/config
echo "overwrite-policy: always" >> $CABAL_ROOT/config
displayName: Update cabal
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-build all --disable-tests --disable-benchmarks --only-dependencies
displayName: Build dependencies
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-build all --disable-tests --disable-benchmarks
displayName: Build `hie`
- bash: |
source .azure/windows-cabal.bashrc
# `hie` binary required locally for tests
# we have to use a separate store for install and builds
# to workaround https://github.com/haskell/cabal/issues/6483
cabal --store-dir ${CABAL_STORE_DIR}i v2-install
displayName: Install `hie`
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-build all --enable-tests --enable-benchmarks --only-dependencies
displayName: Build Test-dependencies
- bash: |
mkdir -p /usr/local
curl -L https://github.com/Z3Prover/z3/releases/download/Z3-4.8.5/z3-4.8.5-x64-win.zip -o /usr/local/z3.zip
unzip -o /usr/local/z3.zip -d /usr/local/
displayName: "Install Runtime Test-Dependencies: z3"
- bash: |
source .azure/windows-cabal.bashrc
choco install -y --ignore-dependencies ghc --version=8.6.5
# to not reinstall hie
cd "$(Agent.TempDirectory)"
cabal v2-install liquidhaskell-$LIQUID_VERSION -w $GHCS_PATH/ghc-8.6.5/bin/ghc.exe
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-build hoogle
cabal v2-exec hoogle generate
displayName: "Install Runtime Test-Dependencies: hoogle database"
- bash: |
curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip
unzip -o /usr/bin/stack.zip -d /usr/bin/
mkdir -p "$STACK_ROOT"
echo "local-programs-path: D:/bin/stack" > $STACK_ROOT/config.yaml
# If we don't install the ghc used in test projects in advance, tests fail
stack setup --resolver=lts-14.20
displayName: "Install Runtime Unit Test-Dependencies: stack"
- bash: |
source .azure/windows-cabal.bashrc
# TODO: Enable CabalHelper tests
if [ $GHC_VERSION = "8.4.4" ]; then
TEST_OPTIONS=--test-options="--skip=CabalHelper"
fi
cabal v2-test :unit-test $TEST_OPTIONS
displayName: "Run Test: unit-test"
# TODO: Enable rest of test suites in windows
- bash: |
source .azure/windows-cabal.bashrc
cabal v2-test :dispatcher-test :plugin-dispatcher-test :wrapper-test
displayName: "Run Test: dispatcher-test, plugin-dispatcher-test and wrapper-test"
condition: False
- bash: |
source .azure/windows-cabal.bashrc
# TODO: Enable for 8.4.4
if [ $GHC_VERSION != "8.4.4" ]; then
cabal v2-test :func-test $TEST_OPTIONS
fi
displayName: "Run Test: func-test"
- bash: |
source .azure/windows-cabal.bashrc
mkdir -p .azure-cache
tar -vczf .azure-cache/cabal-root.tar.gz $CABAL_ROOT
tar -vczf .azure-cache/cabal-store.tar.gz $(cygpath $CABAL_STORE_DIR)
tar -vczf .azure-cache/cabal-store-install.tar.gz $(cygpath $CABAL_STORE_DIR)i
tar -vczf .azure-cache/cabal-dist.tar.gz dist-newstyle
displayName: "Pack cache"