on master help sign in
Add azure job for windows and restructure azure config files (#475)

* Add azure job for windows and ghc-8.6 * Trigger build in branches starting with azure * Add other valid stack.yaml to windows using matrix * Using azure task Cache@2 instead CacheBeta@0 * Ignore tests in windows for now * Install happy standalone to avoid spurious build error * Add comment about installing happy * Use matrix names more consistent with existing ones * Enable build using ghc-8.8.2 for windows * Ignore .vscode dir * Use templates and matrix in linux job

commit8ba58ccdf1199a0a9645bee3dc2dc317fef8d771 authorJavier Neira <atreyu.bbb@gmail.com> dateThu 19 Mar 2020, 12:16 (7 years ago) parentbd53ace
4 files changed+127−184
.azure/linux-stack.yml+57 .azure/windows-stack.yml+66 .gitignore+1 azure-pipelines.yml+3−184
.azure/linux-stack.ymlnew file+57
@@ -0,0 +1,57 @@
1+jobs:
2+- job: ghcide_stack_linux
3+ timeoutInMinutes: 60
4+ pool:
5+ vmImage: 'ubuntu-latest'
6+ strategy:
7+ matrix:
8+ stack_88:
9+ STACK_YAML: "stack88.yaml"
10+ stack_86:
11+ STACK_YAML: "stack.yaml"
12+ stack_84:
13+ STACK_YAML: "stack84.yaml"
14+ stack_ghc_lib_88:
15+ STACK_YAML: "stack-ghc-lib.yaml"
16+ steps:
17+ - checkout: self
18+ - task: Cache@2
19+ inputs:
20+ key: stack-cache-v2 | $(Agent.OS) | $(Build.SourcesDirectory)/stack.yaml | $(Build.SourcesDirectory)/ghcide.cabal
21+ path: .azure-cache
22+ cacheHitVar: CACHE_RESTORED
23+ displayName: "Cache stack artifacts"
24+ - bash: |
25+ mkdir -p ~/.stack
26+ tar xzf .azure-cache/stack-root.tar.gz -C $HOME
27+ displayName: "Unpack cache"
28+ condition: eq(variables.CACHE_RESTORED, 'true')
29+ - bash: |
30+ ./fmt.sh
31+ displayName: "HLint via ./fmt.sh"
32+ - bash: |
33+ sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev
34+ if ! which stack >/dev/null 2>&1; then
35+ curl -sSL https://get.haskellstack.org/ | sh
36+ fi
37+ displayName: 'Install Stack'
38+ - bash: stack setup --stack-yaml=$STACK_YAML
39+ displayName: 'stack setup'
40+ - bash: stack build --only-dependencies --stack-yaml=$STACK_YAML
41+ displayName: 'stack build --only-dependencies'
42+ - bash: stack test --ghc-options=-Werror --stack-yaml=$STACK_YAML || stack test --ghc-options=-Werror --stack-yaml=$STACK_YAML|| stack test --ghc-options=-Werror --stack-yaml=$STACK_YAML
43+ # ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
44+ displayName: 'stack test --ghc-options=-Werror'
45+ - bash: |
46+ mkdir -p .azure-cache
47+ tar czf .azure-cache/stack-root.tar.gz -C $HOME .stack
48+ displayName: "Pack cache"
49+ - bash: |
50+ set -euo pipefail
51+ MESSAGE=$(git log --pretty=format:%s -n1)
52+ curl -XPOST \
53+ -i \
54+ -H 'Content-type: application/json' \
55+ --data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/ghcide/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
56+ $(Slack.URL)
57+ condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master'))
.azure/windows-stack.ymlnew file+66
@@ -0,0 +1,66 @@
1+jobs:
2+- job: ghcide_stack_windows
3+ timeoutInMinutes: 60
4+ pool:
5+ vmImage: 'windows-2019'
6+ strategy:
7+ matrix:
8+ stack_88:
9+ STACK_YAML: "stack88.yaml"
10+ stack_86:
11+ STACK_YAML: "stack.yaml"
12+ stack_84:
13+ STACK_YAML: "stack84.yaml"
14+ stack_ghc_lib_88:
15+ STACK_YAML: "stack-ghc-lib.yaml"
16+ variables:
17+ STACK_ROOT: "C:\\sr"
18+ steps:
19+ - checkout: self
20+ - task: Cache@2
21+ inputs:
22+ key: stack-cache-v2 | $(Agent.OS) | $(Build.SourcesDirectory)/$(STACK_YAML) | $(Build.SourcesDirectory)/ghcide.cabal
23+ path: .azure-cache
24+ cacheHitVar: CACHE_RESTORED
25+ displayName: "Cache stack artifacts"
26+ - bash: |
27+ mkdir -p $STACK_ROOT
28+ tar -vxzf .azure-cache/stack-root.tar.gz -C /c
29+ mkdir -p .stack-work
30+ tar -vxzf .azure-cache/stack-work.tar.gz
31+ displayName: "Unpack cache"
32+ condition: eq(variables.CACHE_RESTORED, 'true')
33+ - bash: |
34+ ./fmt.sh
35+ displayName: "HLint via ./fmt.sh"
36+ - bash: |
37+ curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip
38+ unzip -o /usr/bin/stack.zip -d /usr/bin/
39+ mkdir -p "$STACK_ROOT"
40+ displayName: 'Install Stack'
41+ - bash: stack setup --stack-yaml $STACK_YAML
42+ displayName: 'stack setup'
43+ - bash: |
44+ # Installing happy standalone to avoid error "strip.exe: unable to rename ../happy.exe; reason: File exists"
45+ stack install happy --stack-yaml $STACK_YAML
46+ stack build --only-dependencies --stack-yaml $STACK_YAML
47+ displayName: 'stack build --only-dependencies'
48+ - bash: stack test --ghc-options=-Werror --stack-yaml $STACK_YAML || stack test --ghc-options=-Werror --stack-yaml $STACK_YAML || stack test --ghc-options=-Werror --stack-yaml $STACK_YAML
49+ # ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
50+ displayName: 'stack test --ghc-options=-Werror'
51+ # TODO: Enable when failing tests are fixed or marked as broken. See https://github.com/digital-asset/ghcide/issues/474
52+ condition: False
53+ - bash: |
54+ mkdir -p .azure-cache
55+ tar -vczf .azure-cache/stack-root.tar.gz $(cygpath $STACK_ROOT)
56+ tar -vczf .azure-cache/stack-work.tar.gz .stack-work
57+ displayName: "Pack cache"
58+ - bash: |
59+ set -euo pipefail
60+ MESSAGE=$(git log --pretty=format:%s -n1)
61+ curl -XPOST \
62+ -i \
63+ -H 'Content-type: application/json' \
64+ --data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/ghcide/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
65+ $(Slack.URL)
66+ condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master'))
.gitignore+1
@@ -5,3 +5,4 @@ cabal.project.local
55*~
66*.lock
77/.tasty-rerun-log
8+.vscode
azure-pipelines.yml+3−184
@@ -4,6 +4,7 @@ trigger:
44 branches:
55 include:
66 - master
7+ - azure*
78
89# Enable PR triggers that target the master branch
910pr:
@@ -13,187 +14,5 @@ pr:
1314 - master
1415
1516jobs:
16− - job: ghcide_stack_86
17− timeoutInMinutes: 60
18− pool:
19− vmImage: 'ubuntu-latest'
20− steps:
21− - checkout: self
22− - task: CacheBeta@0
23− inputs:
24− key: stack-cache-v2 | $(Agent.OS) | $(Build.SourcesDirectory)/stack.yaml | $(Build.SourcesDirectory)/ghcide.cabal
25− path: .azure-cache
26− cacheHitVar: CACHE_RESTORED
27− displayName: "Cache stack artifacts"
28− - bash: |
29− mkdir -p ~/.stack
30− tar xzf .azure-cache/stack-root.tar.gz -C $HOME
31− displayName: "Unpack cache"
32− condition: eq(variables.CACHE_RESTORED, 'true')
33− - bash: |
34− ./fmt.sh
35− displayName: "HLint via ./fmt.sh"
36− - bash: |
37− sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev
38− if ! which stack >/dev/null 2>&1; then
39− curl -sSL https://get.haskellstack.org/ | sh
40− fi
41− displayName: 'Install Stack'
42− - bash: stack setup
43− displayName: 'stack setup'
44− - bash: stack build --only-dependencies
45− displayName: 'stack build --only-dependencies'
46− - bash: stack test --ghc-options=-Werror || stack test --ghc-options=-Werror || stack test --ghc-options=-Werror
47− # ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
48− displayName: 'stack test --ghc-options=-Werror'
49− - bash: |
50− mkdir -p .azure-cache
51− tar czf .azure-cache/stack-root.tar.gz -C $HOME .stack
52− displayName: "Pack cache"
53− - bash: |
54− set -euo pipefail
55− MESSAGE=$(git log --pretty=format:%s -n1)
56− curl -XPOST \
57− -i \
58− -H 'Content-type: application/json' \
59− --data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/ghcide/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
60− $(Slack.URL)
61− condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master'))
62− - job: ghcide_stack_84
63− timeoutInMinutes: 60
64− pool:
65− vmImage: 'ubuntu-latest'
66− steps:
67− - checkout: self
68− - task: CacheBeta@0
69− inputs:
70− key: stack-cache-v2 | $(Agent.OS) | $(Build.SourcesDirectory)/stack84.yaml | $(Build.SourcesDirectory)/ghcide.cabal
71− path: .azure-cache
72− cacheHitVar: CACHE_RESTORED
73− displayName: "Cache stack artifacts"
74− - bash: |
75− mkdir -p ~/.stack
76− tar xzf .azure-cache/stack-root.tar.gz -C $HOME
77− displayName: "Unpack cache"
78− condition: eq(variables.CACHE_RESTORED, 'true')
79− - bash: |
80− ./fmt.sh
81− displayName: "HLint via ./fmt.sh"
82− - bash: |
83− sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev
84− if ! which stack >/dev/null 2>&1; then
85− curl -sSL https://get.haskellstack.org/ | sh
86− fi
87− displayName: 'Install Stack'
88− - bash: stack setup --stack-yaml=stack84.yaml
89− displayName: 'stack setup --stack-yaml=stack84.yaml'
90− - bash: stack build --only-dependencies --stack-yaml=stack84.yaml
91− displayName: 'stack build --only-dependencies --stack-yaml=stack84.yaml'
92− - bash: stack test --stack-yaml=stack84.yaml --ghc-options=-Werror || stack test --stack-yaml=stack84.yaml --ghc-options=-Werror || stack test --stack-yaml=stack84.yaml --ghc-options=-Werror
93− # ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
94− displayName: 'stack test --stack-yaml=stack84.yaml --ghc-options=-Werror'
95− - bash: |
96− mkdir -p .azure-cache
97− tar czf .azure-cache/stack-root.tar.gz -C $HOME .stack
98− displayName: "Pack cache"
99− - bash: |
100− set -euo pipefail
101− MESSAGE=$(git log --pretty=format:%s -n1)
102− curl -XPOST \
103− -i \
104− -H 'Content-type: application/json' \
105− --data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/ghcide/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
106− $(Slack.URL)
107− condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master'))
108− - job: ghcide_stack_88
109− timeoutInMinutes: 60
110− pool:
111− vmImage: 'ubuntu-latest'
112− steps:
113− - checkout: self
114− - task: CacheBeta@0
115− inputs:
116− key: stack-cache-v2 | $(Agent.OS) | $(Build.SourcesDirectory)/stack88.yaml | $(Build.SourcesDirectory)/ghcide.cabal
117− path: .azure-cache
118− cacheHitVar: CACHE_RESTORED
119− displayName: "Cache stack artifacts"
120− - bash: |
121− mkdir -p ~/.stack
122− tar xzf .azure-cache/stack-root.tar.gz -C $HOME
123− displayName: "Unpack cache"
124− condition: eq(variables.CACHE_RESTORED, 'true')
125− - bash: |
126− ./fmt.sh
127− displayName: "HLint via ./fmt.sh"
128− - bash: |
129− sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev
130− if ! which stack >/dev/null 2>&1; then
131− curl -sSL https://get.haskellstack.org/ | sh
132− fi
133− displayName: 'Install Stack'
134− - bash: stack setup --stack-yaml=stack88.yaml
135− displayName: 'stack setup --stack-yaml=stack88.yaml'
136− - bash: stack build --only-dependencies --stack-yaml=stack88.yaml
137− displayName: 'stack build --only-dependencies --stack-yaml=stack88.yaml'
138− - bash: stack test --stack-yaml=stack88.yaml --ghc-options=-Werror || stack test --stack-yaml=stack88.yaml --ghc-options=-Werror || stack test --stack-yaml=stack88.yaml --ghc-options=-Werror
139− # ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
140− displayName: 'stack test --stack-yaml=stack88.yaml --ghc-options=-Werror'
141− - bash: |
142− mkdir -p .azure-cache
143− tar czf .azure-cache/stack-root.tar.gz -C $HOME .stack
144− displayName: "Pack cache"
145− - bash: |
146− set -euo pipefail
147− MESSAGE=$(git log --pretty=format:%s -n1)
148− curl -XPOST \
149− -i \
150− -H 'Content-type: application/json' \
151− --data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/ghcide/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
152− $(Slack.URL)
153− condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master'))
154− - job: ghcide_stack_ghc_lib_88
155− timeoutInMinutes: 60
156− pool:
157− vmImage: 'ubuntu-latest'
158− steps:
159− - checkout: self
160− - task: CacheBeta@0
161− inputs:
162− key: stack-cache-v2 | $(Agent.OS) | $(Build.SourcesDirectory)/stack-ghc-lib.yaml | $(Build.SourcesDirectory)/ghcide.cabal
163− path: .azure-cache
164− cacheHitVar: CACHE_RESTORED
165− displayName: "Cache stack artifacts"
166− - bash: |
167− mkdir -p ~/.stack
168− tar xzf .azure-cache/stack-root.tar.gz -C $HOME
169− displayName: "Unpack cache"
170− condition: eq(variables.CACHE_RESTORED, 'true')
171− - bash: |
172− ./fmt.sh
173− displayName: "HLint via ./fmt.sh"
174− - bash: |
175− sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev
176− if ! which stack >/dev/null 2>&1; then
177− curl -sSL https://get.haskellstack.org/ | sh
178− fi
179− displayName: 'Install Stack'
180− - bash: stack setup --stack-yaml=stack-ghc-lib.yaml
181− displayName: 'stack setup --stack-yaml=stack-ghc-lib.yaml'
182− - bash: stack build --only-dependencies --stack-yaml=stack-ghc-lib.yaml
183− displayName: 'stack build --only-dependencies --stack-yaml=stack-ghc-lib.yaml'
184− - bash: stack test --stack-yaml=stack-ghc-lib.yaml --ghc-options=-Werror || stack test --stack-yaml=stack-ghc-lib.yaml --ghc-options=-Werror || stack test --stack-yaml=stack-ghc-lib.yaml --ghc-options=-Werror
185− # ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
186− displayName: 'stack test --stack-yaml=stack-ghc-lib.yaml --ghc-options=-Werror'
187− - bash: |
188− mkdir -p .azure-cache
189− tar czf .azure-cache/stack-root.tar.gz -C $HOME .stack
190− displayName: "Pack cache"
191− - bash: |
192− set -euo pipefail
193− MESSAGE=$(git log --pretty=format:%s -n1)
194− curl -XPOST \
195− -i \
196− -H 'Content-type: application/json' \
197− --data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/ghcide/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
198− $(Slack.URL)
199− condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master'))
17+ - template: ./.azure/linux-stack.yml
18+ - template: ./.azure/windows-stack.yml