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

Commit eae2e4b

Browse files
authored
Merge pull request #1595 from jneira/azure
* Separate test suites: * To handle specific conditions, make log inspection easier and run them with cabal without `-j1` * unit-test * dipatcher-test, plugin-dispatcher-test, wrapper-test * functional-test * Add ghc-8.8.1 to linux and macos jobs (#1593) * Add cache to installhs jobs * Install ghc's in windows+stack jobs in drive `D:` to avoid errors about no space in `C:` * Change stack_root to `D:` in windows+stack for the same reason * Add new job windows+cabal for ghc 8.6.5 and ghc-8.4.4 * Using chocolatey to download cabal and ghc * Separating the `store-dir` of builds and install to avoid haskell/cabal#6483 * Enable installhs job for windows+cabal * Other minor fixes
2 parents 93d3574 + 5561141 commit eae2e4b

12 files changed

+357
-86
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
@@ -21,6 +21,7 @@ jobs:
2121
YAML_FILE: stack-8.4.2.yaml
2222
variables:
2323
STACK_ROOT: /home/vsts/.stack
24+
CABAL_VERSION: "3.0"
2425
steps:
2526
- task: Cache@2
2627
inputs:
@@ -62,17 +63,17 @@ jobs:
6263
stack install --stack-yaml $(YAML_FILE) --local-bin-path .azure-deploy
6364
cd .azure-deploy
6465
if [ $YAML_FILE != "stack.yaml" ]; then
65-
GHC_MINOR_VERSION=${YAML_FILE:6:5}
66+
GHC_VERSION=${YAML_FILE:6:5}
6667
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
67-
cp hie hie-$GHC_MINOR_VERSION
68+
cp hie hie-$GHC_VERSION
6869
cp hie hie-$GHC_MAJOR_VERSION
6970
else
7071
GHC_MINOR_VERSION=nightly
7172
fi
7273
stack unpack hlint --stack-yaml ../$(YAML_FILE) --to "$(Agent.TempDirectory)"
7374
mkdir -p data
7475
cp "$(Agent.TempDirectory)"/hlint*/data/hlint.yaml data
75-
ARTIFACT_NAME=hie-$(hie --numeric-version)-ghc-$GHC_MINOR_VERSION-linux-x86_64
76+
ARTIFACT_NAME=hie-$(hie --numeric-version)-ghc-$GHC_VERSION-linux-x86_64
7677
tar -vczf $(Build.ArtifactStagingDirectory)/$ARTIFACT_NAME.tar.xz *
7778
displayName: Install `hie`
7879
- bash: |
@@ -94,10 +95,18 @@ jobs:
9495
displayName: "Install Runtime Test-Dependencies: hoogle database"
9596
- bash: |
9697
source .azure/linux-stack.bashrc
97-
# cabal is also a test runtime dependency
98-
export PATH=/opt/cabal/3.0/bin:$PATH
99-
stack test --stack-yaml $(YAML_FILE)
100-
displayName: Run Test
98+
# cabal is also a test runtime dependency for unit-test suite
99+
export PATH=/opt/cabal/$CABAL_VERSION/bin:$PATH
100+
stack test :unit-test --stack-yaml $(YAML_FILE)
101+
displayName: "Run Test: unit-test"
102+
- bash: |
103+
source .azure/linux-stack.bashrc
104+
stack test :dispatcher-test :plugin-dispatcher-test :wrapper-test --stack-yaml $(YAML_FILE)
105+
displayName: "Run Test: dispatcher-test, plugin-dispatcher-test and wrapper-test"
106+
- bash: |
107+
source .azure/linux-stack.bashrc
108+
stack test :func-test --stack-yaml $(YAML_FILE)
109+
displayName: "Run Test: func-test"
101110
- task: PublishBuildArtifacts@1
102111
inputs:
103112
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
@@ -63,17 +63,17 @@ jobs:
6363
stack install --stack-yaml $(YAML_FILE) --local-bin-path .azure-deploy
6464
cd .azure-deploy
6565
if [ $YAML_FILE != "stack.yaml" ]; then
66-
GHC_MINOR_VERSION=${YAML_FILE:6:5}
66+
GHC_VERSION=${YAML_FILE:6:5}
6767
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
68-
cp hie hie-$GHC_MINOR_VERSION
68+
cp hie hie-$GHC_VERSION
6969
cp hie hie-$GHC_MAJOR_VERSION
7070
else
71-
GHC_MINOR_VERSION=nightly
71+
GHC_VERSION=nightly
7272
fi
7373
stack unpack hlint --stack-yaml ../$(YAML_FILE) --to "$(Agent.TempDirectory)"
7474
mkdir -p data
7575
cp "$(Agent.TempDirectory)"/hlint*/data/hlint.yaml data
76-
ARTIFACT_NAME=hie-$(hie --numeric-version)-ghc-$GHC_MINOR_VERSION-macos-x86_64
76+
ARTIFACT_NAME=hie-$(hie --numeric-version)-ghc-$GHC_VERSION-macos-x86_64
7777
tar -vczf $(Build.ArtifactStagingDirectory)/$ARTIFACT_NAME.tar.xz *
7878
displayName: Install `hie`
7979
- bash: |
@@ -98,17 +98,31 @@ jobs:
9898
- bash: |
9999
source .azure/macos.bashrc
100100
brew install cabal-install
101-
displayName: "Install Runtime Test-Dependencies: cabal"
101+
displayName: "Install Runtime Unit Test-Dependencies: cabal"
102+
- bash: |
103+
source .azure/macos.bashrc
104+
stack test :unit-test --stack-yaml $(YAML_FILE)
105+
displayName: "Run Test: unit-test"
106+
# TODO: Enable dispatcher-test for ghc-8.4.*
102107
- bash: |
103108
source .azure/macos.bashrc
104109
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
105110
if [ $GHC_MAJOR_VERSION != "8.4" ]; then
106-
stack test --stack-yaml $(YAML_FILE)
111+
TEST_TARGETS=:dispatcher-test :plugin-dispatcher-test :wrapper-test
107112
else
108-
#TODO Enable dispatcher-test and func-test for ghc-8.4.*
109-
stack test --stack-yaml $(YAML_FILE) :unit-test :plugin-dispatcher-test :wrapper-test
113+
TEST_TARGETS=:plugin-dispatcher-test :wrapper-test
114+
fi
115+
stack test $TEST_TARGETS --stack-yaml $(YAML_FILE)
116+
displayName: "Run Test: dispatcher-test, plugin-dispatcher-test and wrapper-test"
117+
condition: False
118+
# TODO: Enable func-test for ghc-8.4.*
119+
- bash: |
120+
source .azure/macos.bashrc
121+
GHC_MAJOR_VERSION=${YAML_FILE:6:3}
122+
if [ $GHC_MAJOR_VERSION != "8.4" ]; then
123+
stack test :func-test --stack-yaml $(YAML_FILE)
110124
fi
111-
displayName: Run Test
125+
displayName: "Run Test: func-test"
112126
- task: PublishBuildArtifacts@1
113127
inputs:
114128
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)