Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit db3b78b

Browse files
committed
Add windows+cabal job and improvements
1 parent 86ccb3d commit db3b78b

12 files changed

+354
-85
lines changed

.azure/linux-cabal.yml

+30-10
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@ jobs:
55
vmImage: ubuntu-16.04
66
strategy:
77
matrix:
8+
# Fail with compilation error building haddock-api
9+
# ghc-8.8.2:
10+
# GHC_VERSION: "8.8.2"
11+
ghc-8.8.1:
12+
GHC_VERSION: "8.8.1"
813
ghc-8.6.5:
914
GHC_VERSION: "8.6.5"
1015
ghc-8.4.4:
1116
GHC_VERSION: "8.4.4"
1217
variables:
1318
CABAL_VERSION: "3.0"
19+
LIQUID_VERSION: "0.8.6.2"
1420
steps:
1521
- task: Cache@2
1622
inputs:
17-
key: '"cabal-store" | "$(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'
23+
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'
1824
path: .azure-cache
1925
cacheHitVar: CACHE_RESTORED
2026
displayName: "Download cache"
@@ -23,26 +29,34 @@ jobs:
2329
tar -vxzf .azure-cache/cabal-root.tar.gz -C /
2430
mkdir -p $HOME/.ghc
2531
tar -vxzf .azure-cache/ghc-root.tar.gz -C /
26-
mkdir -p dist-newtyle
32+
mkdir -p dist-newstyle
2733
tar -vxzf .azure-cache/cabal-dist.tar.gz
2834
displayName: "Unpack cache"
2935
condition: eq(variables.CACHE_RESTORED, 'true')
3036
- bash: |
3137
git submodule sync
3238
git submodule update --init
3339
displayName: Sync submodules
40+
- bash: |
41+
# To install ghc if they are not yet included in the agent image
42+
ghc --version || (sudo apt-get update && sudo apt-get install -y ghc-$GHC_VERSION)
43+
displayName: Install ghc
3444
- bash: |
3545
source .azure/linux-cabal.bashrc
3646
cabal v2-update
37-
cabal v2-build --only-dependencies
47+
echo "overwrite-policy: always" >> $HOME/.cabal/config
48+
displayName: Update cabal
49+
- bash: |
50+
source .azure/linux-cabal.bashrc
51+
cabal v2-build --disable-tests --disable-benchmarks --only-dependencies
3852
displayName: Build dependencies
3953
- bash: |
4054
source .azure/linux-cabal.bashrc
41-
cabal v2-build
55+
cabal v2-build --disable-tests --disable-benchmarks
4256
displayName: Build `hie`
4357
- bash: |
4458
source .azure/linux-cabal.bashrc
45-
cabal v2-install --overwrite-policy=always # `hie` binary required locally for tests
59+
cabal v2-install # `hie` binary required locally for tests
4660
displayName: Install `hie`
4761
- bash: |
4862
source .azure/linux-cabal.bashrc
@@ -54,9 +68,8 @@ jobs:
5468
displayName: "Install Runtime Test-Dependencies: z3"
5569
- bash: |
5670
source .azure/linux-cabal.bashrc
57-
# to not reinstall hie
5871
cd $(Agent.TempDirectory)
59-
cabal v2-install liquidhaskell-0.8.6.2 -w /opt/ghc/8.6.5/bin/ghc --overwrite-policy=always
72+
cabal v2-install liquidhaskell-$LIQUID_VERSION -w /opt/ghc/8.6.5/bin/ghc
6073
displayName: "Install Runtime Test-Dependencies: liquidhaskell"
6174
- bash: |
6275
source .azure/linux-cabal.bashrc
@@ -65,9 +78,16 @@ jobs:
6578
displayName: "Install Runtime Test-Dependencies: hoogle database"
6679
- bash: |
6780
source .azure/linux-cabal.bashrc
68-
# TODO: Investigate why the test suite can't be run in parallel
69-
cabal v2-test -j1
70-
displayName: Run Test
81+
cabal v2-test :unit-test
82+
displayName: "Run Test: unit-test"
83+
- bash: |
84+
source .azure/linux-cabal.bashrc
85+
cabal v2-test :dispatcher-test :plugin-dispatcher-test :wrapper-test
86+
displayName: "Run Test: dispatcher-test, plugin-dispatcher-test and wrapper-test"
87+
- bash: |
88+
source .azure/linux-cabal.bashrc
89+
cabal v2-test :func-test
90+
displayName: "Run Test: func-test"
7191
- bash: |
7292
mkdir -p .azure-cache
7393
tar -vczf .azure-cache/cabal-root.tar.gz $HOME/.cabal

.azure/linux-installhs-stack.yml

+26-5
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,50 @@ jobs:
66
variables:
77
YAML_FILE: install/shake.yaml
88
steps:
9+
- task: Cache@2
10+
inputs:
11+
key: '"stack" | "$(Agent.OS)" | $(Build.SourcesDirectory)/$(YAML_FILE) | $(Build.SourcesDirectory)/install/shake.yaml'
12+
path: .azure-cache
13+
cacheHitVar: CACHE_RESTORED
14+
displayName: "Cache stack-root"
15+
- bash: |
16+
mkdir -p $STACK_ROOT
17+
tar -vxzf .azure-cache/stack-root.tar.gz -C /
18+
mkdir -p .stack-work
19+
tar -vxzf .azure-cache/stack-work.tar.gz
20+
mkdir -p ./install/.stack-work
21+
tar -vxzf .azure-cache/install-stack-work.tar.gz
22+
displayName: "Unpack cache"
23+
condition: eq(variables.CACHE_RESTORED, 'true')
924
- bash: |
1025
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root
1126
mkdir -p ~/.local/bin
1227
curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | \
1328
tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
1429
displayName: Install stack
1530
- bash: |
16-
source .azure/linux.bashrc
31+
source .azure/linux-stack.bashrc
1732
stack setup --stack-yaml $(YAML_FILE)
1833
displayName: Install GHC
1934
- bash: |
20-
source .azure/linux.bashrc
35+
source .azure/linux-stack.bashrc
2136
stack --stack-yaml $(YAML_FILE) --install-ghc build --only-dependencies
2237
displayName: Build dependencies
2338
- bash: |
24-
source .azure/linux.bashrc
39+
source .azure/linux-stack.bashrc
2540
stack build --stack-yaml $(YAML_FILE)
2641
displayName: Build `hie-install`
2742
- bash: |
28-
source .azure/linux.bashrc
43+
source .azure/linux-stack.bashrc
2944
stack install.hs help
3045
displayName: Run help of `install.hs`
3146
- bash: |
32-
source .azure/linux.bashrc
47+
source .azure/linux-stack.bashrc
3348
stack install.hs latest
3449
displayName: Run latest target of `install.hs`
50+
- bash: |
51+
mkdir -p .azure-cache
52+
tar -vczf .azure-cache/stack-root.tar.gz $(cygpath $STACK_ROOT)
53+
tar -vczf .azure-cache/stack-work.tar.gz .stack-work
54+
tar -vczf .azure-cache/install-stack-work.tar.gz ./install/.stack-work
55+
displayName: "Pack cache"

.azure/linux-stack.yml

+16-7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
YAML_FILE: stack-8.4.2.yaml
2828
variables:
2929
STACK_ROOT: /home/vsts/.stack
30+
CABAL_VERSION: "3.0"
3031
steps:
3132
- task: Cache@2
3233
inputs:
@@ -68,17 +69,17 @@ jobs:
6869
stack install --stack-yaml $(YAML_FILE) --local-bin-path .azure-deploy
6970
cd .azure-deploy
7071
if [ $YAML_FILE != "stack.yaml" ]; then
71-
GHC_MINOR_VERSION=${YAML_FILE:6:5}
72+
GHC_VERSION=${YAML_FILE:6:5}
7273
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
73-
cp hie hie-$GHC_MINOR_VERSION
74+
cp hie hie-$GHC_VERSION
7475
cp hie hie-$GHC_MAJOR_VERSION
7576
else
7677
GHC_MINOR_VERSION=nightly
7778
fi
7879
stack unpack hlint --stack-yaml ../$(YAML_FILE) --to "$(Agent.TempDirectory)"
7980
mkdir -p data
8081
cp "$(Agent.TempDirectory)"/hlint*/data/hlint.yaml data
81-
ARTIFACT_NAME=hie-$(hie --numeric-version)-ghc-$GHC_MINOR_VERSION-linux-x86_64
82+
ARTIFACT_NAME=hie-$(hie --numeric-version)-ghc-$GHC_VERSION-linux-x86_64
8283
tar -vczf $(Build.ArtifactStagingDirectory)/$ARTIFACT_NAME.tar.xz *
8384
displayName: Install `hie`
8485
- bash: |
@@ -100,10 +101,18 @@ jobs:
100101
displayName: "Install Runtime Test-Dependencies: hoogle database"
101102
- bash: |
102103
source .azure/linux-stack.bashrc
103-
# cabal is also a test runtime dependency
104-
export PATH=/opt/cabal/3.0/bin:$PATH
105-
stack test --stack-yaml $(YAML_FILE)
106-
displayName: Run Test
104+
# cabal is also a test runtime dependency for unit-test suite
105+
export PATH=/opt/cabal/$CABAL_VERSION/bin:$PATH
106+
stack test :unit-test --stack-yaml $(YAML_FILE)
107+
displayName: "Run Test: unit-test"
108+
- bash: |
109+
source .azure/linux-stack.bashrc
110+
stack test :dispatcher-test :plugin-dispatcher-test :wrapper-test --stack-yaml $(YAML_FILE)
111+
displayName: "Run Test: dispatcher-test, plugin-dispatcher-test and wrapper-test"
112+
- bash: |
113+
source .azure/linux-stack.bashrc
114+
stack test :func-test --stack-yaml $(YAML_FILE)
115+
displayName: "Run Test: func-test"
107116
- task: PublishBuildArtifacts@1
108117
inputs:
109118
pathtoPublish: '$(Build.ArtifactStagingDirectory)'

.azure/macos-installhs-stack.yml

+21
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ jobs:
66
variables:
77
YAML_FILE: install/shake.yaml
88
steps:
9+
- task: Cache@2
10+
inputs:
11+
key: '"stack" | "$(Agent.OS)" | $(Build.SourcesDirectory)/$(YAML_FILE) | $(Build.SourcesDirectory)/install/shake.yaml'
12+
path: .azure-cache
13+
cacheHitVar: CACHE_RESTORED
14+
displayName: "Cache stack-root"
15+
- bash: |
16+
mkdir -p $STACK_ROOT
17+
tar -vxzf .azure-cache/stack-root.tar.gz -C /
18+
mkdir -p .stack-work
19+
tar -vxzf .azure-cache/stack-work.tar.gz
20+
mkdir -p ./install/.stack-work
21+
tar -vxzf .azure-cache/install-stack-work.tar.gz
22+
displayName: "Unpack cache"
23+
condition: eq(variables.CACHE_RESTORED, 'true')
924
- bash: |
1025
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root
1126
mkdir -p ~/.local/bin
@@ -32,3 +47,9 @@ jobs:
3247
source .azure/macos.bashrc
3348
stack install.hs latest
3449
displayName: Run latest target of `install.hs`
50+
- bash: |
51+
mkdir -p .azure-cache
52+
tar -vczf .azure-cache/stack-root.tar.gz $(cygpath $STACK_ROOT)
53+
tar -vczf .azure-cache/stack-work.tar.gz .stack-work
54+
tar -vczf .azure-cache/install-stack-work.tar.gz ./install/.stack-work
55+
displayName: "Pack cache"

.azure/macos-stack.yml

+23-9
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ jobs:
6565
stack install --stack-yaml $(YAML_FILE) --local-bin-path .azure-deploy
6666
cd .azure-deploy
6767
if [ $YAML_FILE != "stack.yaml" ]; then
68-
GHC_MINOR_VERSION=${YAML_FILE:6:5}
68+
GHC_VERSION=${YAML_FILE:6:5}
6969
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
70-
cp hie hie-$GHC_MINOR_VERSION
70+
cp hie hie-$GHC_VERSION
7171
cp hie hie-$GHC_MAJOR_VERSION
7272
else
73-
GHC_MINOR_VERSION=nightly
73+
GHC_VERSION=nightly
7474
fi
7575
stack unpack hlint --stack-yaml ../$(YAML_FILE) --to "$(Agent.TempDirectory)"
7676
mkdir -p data
7777
cp "$(Agent.TempDirectory)"/hlint*/data/hlint.yaml data
78-
ARTIFACT_NAME=hie-$(hie --numeric-version)-ghc-$GHC_MINOR_VERSION-macos-x86_64
78+
ARTIFACT_NAME=hie-$(hie --numeric-version)-ghc-$GHC_VERSION-macos-x86_64
7979
tar -vczf $(Build.ArtifactStagingDirectory)/$ARTIFACT_NAME.tar.xz *
8080
displayName: Install `hie`
8181
- bash: |
@@ -100,17 +100,31 @@ jobs:
100100
- bash: |
101101
source .azure/macos.bashrc
102102
brew install cabal-install
103-
displayName: "Install Runtime Test-Dependencies: cabal"
103+
displayName: "Install Runtime Unit Test-Dependencies: cabal"
104+
- bash: |
105+
source .azure/macos.bashrc
106+
stack test :unit-test --stack-yaml $(YAML_FILE)
107+
displayName: "Run Test: unit-test"
108+
# TODO: Enable dispatcher-test for ghc-8.4.*
104109
- bash: |
105110
source .azure/macos.bashrc
106111
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
107112
if [ $GHC_MAJOR_VERSION != "8.4" ]; then
108-
stack test --stack-yaml $(YAML_FILE)
113+
TEST_TARGETS=:dispatcher-test :plugin-dispatcher-test :wrapper-test
109114
else
110-
#TODO Enable dispatcher-test and func-test for ghc-8.4.*
111-
stack test --stack-yaml $(YAML_FILE) :unit-test :plugin-dispatcher-test :wrapper-test
115+
TEST_TARGETS=:plugin-dispatcher-test :wrapper-test
116+
fi
117+
stack test $TEST_TARGETS --stack-yaml $(YAML_FILE)
118+
displayName: "Run Test: dispatcher-test, plugin-dispatcher-test and wrapper-test"
119+
condition: False
120+
# TODO: Enable func-test for ghc-8.4.*
121+
- bash: |
122+
source .azure/macos.bashrc
123+
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
124+
if [ $GHC_MAJOR_VERSION != "8.4" ]; then
125+
stack test :func-test --stack-yaml $(YAML_FILE)
112126
fi
113-
displayName: Run Test
127+
displayName: "Run Test: func-test"
114128
- task: PublishBuildArtifacts@1
115129
inputs:
116130
pathtoPublish: '$(Build.ArtifactStagingDirectory)'

.azure/windows-cabal.bashrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export GHCS_PATH=$(cygpath $ProgramData)/chocolatey/lib/ghc/tools
2+
export GHC_PATH=$GHCS_PATH/ghc-$GHC_VERSION
3+
export CABAL_ROOT=$(cygpath $APPDATA)/cabal
4+
export Z3_BIN_PATH=/usr/local/z3-4.8.5-x64-win/bin
5+
export PATH=$CABAL_ROOT/bin:$GHC_PATH/bin:$Z3_BIN_PATH:$PATH

0 commit comments

Comments
 (0)