mirror of
https://github.com/haskell/ghcide.git
synced 2024-11-08 22:12:43 +03:00
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
This commit is contained in:
parent
bd53aced70
commit
8ba58ccdf1
57
.azure/linux-stack.yml
Normal file
57
.azure/linux-stack.yml
Normal file
@ -0,0 +1,57 @@
|
||||
jobs:
|
||||
- job: ghcide_stack_linux
|
||||
timeoutInMinutes: 60
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
strategy:
|
||||
matrix:
|
||||
stack_88:
|
||||
STACK_YAML: "stack88.yaml"
|
||||
stack_86:
|
||||
STACK_YAML: "stack.yaml"
|
||||
stack_84:
|
||||
STACK_YAML: "stack84.yaml"
|
||||
stack_ghc_lib_88:
|
||||
STACK_YAML: "stack-ghc-lib.yaml"
|
||||
steps:
|
||||
- checkout: self
|
||||
- task: Cache@2
|
||||
inputs:
|
||||
key: stack-cache-v2 | $(Agent.OS) | $(Build.SourcesDirectory)/stack.yaml | $(Build.SourcesDirectory)/ghcide.cabal
|
||||
path: .azure-cache
|
||||
cacheHitVar: CACHE_RESTORED
|
||||
displayName: "Cache stack artifacts"
|
||||
- bash: |
|
||||
mkdir -p ~/.stack
|
||||
tar xzf .azure-cache/stack-root.tar.gz -C $HOME
|
||||
displayName: "Unpack cache"
|
||||
condition: eq(variables.CACHE_RESTORED, 'true')
|
||||
- bash: |
|
||||
./fmt.sh
|
||||
displayName: "HLint via ./fmt.sh"
|
||||
- bash: |
|
||||
sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev
|
||||
if ! which stack >/dev/null 2>&1; then
|
||||
curl -sSL https://get.haskellstack.org/ | sh
|
||||
fi
|
||||
displayName: 'Install Stack'
|
||||
- bash: stack setup --stack-yaml=$STACK_YAML
|
||||
displayName: 'stack setup'
|
||||
- bash: stack build --only-dependencies --stack-yaml=$STACK_YAML
|
||||
displayName: 'stack build --only-dependencies'
|
||||
- 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
|
||||
# ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
|
||||
displayName: 'stack test --ghc-options=-Werror'
|
||||
- bash: |
|
||||
mkdir -p .azure-cache
|
||||
tar czf .azure-cache/stack-root.tar.gz -C $HOME .stack
|
||||
displayName: "Pack cache"
|
||||
- bash: |
|
||||
set -euo pipefail
|
||||
MESSAGE=$(git log --pretty=format:%s -n1)
|
||||
curl -XPOST \
|
||||
-i \
|
||||
-H 'Content-type: application/json' \
|
||||
--data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/ghcide/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
|
||||
$(Slack.URL)
|
||||
condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master'))
|
66
.azure/windows-stack.yml
Normal file
66
.azure/windows-stack.yml
Normal file
@ -0,0 +1,66 @@
|
||||
jobs:
|
||||
- job: ghcide_stack_windows
|
||||
timeoutInMinutes: 60
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
strategy:
|
||||
matrix:
|
||||
stack_88:
|
||||
STACK_YAML: "stack88.yaml"
|
||||
stack_86:
|
||||
STACK_YAML: "stack.yaml"
|
||||
stack_84:
|
||||
STACK_YAML: "stack84.yaml"
|
||||
stack_ghc_lib_88:
|
||||
STACK_YAML: "stack-ghc-lib.yaml"
|
||||
variables:
|
||||
STACK_ROOT: "C:\\sr"
|
||||
steps:
|
||||
- checkout: self
|
||||
- task: Cache@2
|
||||
inputs:
|
||||
key: stack-cache-v2 | $(Agent.OS) | $(Build.SourcesDirectory)/$(STACK_YAML) | $(Build.SourcesDirectory)/ghcide.cabal
|
||||
path: .azure-cache
|
||||
cacheHitVar: CACHE_RESTORED
|
||||
displayName: "Cache stack artifacts"
|
||||
- bash: |
|
||||
mkdir -p $STACK_ROOT
|
||||
tar -vxzf .azure-cache/stack-root.tar.gz -C /c
|
||||
mkdir -p .stack-work
|
||||
tar -vxzf .azure-cache/stack-work.tar.gz
|
||||
displayName: "Unpack cache"
|
||||
condition: eq(variables.CACHE_RESTORED, 'true')
|
||||
- bash: |
|
||||
./fmt.sh
|
||||
displayName: "HLint via ./fmt.sh"
|
||||
- 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"
|
||||
displayName: 'Install Stack'
|
||||
- bash: stack setup --stack-yaml $STACK_YAML
|
||||
displayName: 'stack setup'
|
||||
- bash: |
|
||||
# Installing happy standalone to avoid error "strip.exe: unable to rename ../happy.exe; reason: File exists"
|
||||
stack install happy --stack-yaml $STACK_YAML
|
||||
stack build --only-dependencies --stack-yaml $STACK_YAML
|
||||
displayName: 'stack build --only-dependencies'
|
||||
- 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
|
||||
# ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
|
||||
displayName: 'stack test --ghc-options=-Werror'
|
||||
# TODO: Enable when failing tests are fixed or marked as broken. See https://github.com/digital-asset/ghcide/issues/474
|
||||
condition: False
|
||||
- bash: |
|
||||
mkdir -p .azure-cache
|
||||
tar -vczf .azure-cache/stack-root.tar.gz $(cygpath $STACK_ROOT)
|
||||
tar -vczf .azure-cache/stack-work.tar.gz .stack-work
|
||||
displayName: "Pack cache"
|
||||
- bash: |
|
||||
set -euo pipefail
|
||||
MESSAGE=$(git log --pretty=format:%s -n1)
|
||||
curl -XPOST \
|
||||
-i \
|
||||
-H 'Content-type: application/json' \
|
||||
--data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/ghcide/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
|
||||
$(Slack.URL)
|
||||
condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master'))
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ cabal.project.local
|
||||
*~
|
||||
*.lock
|
||||
/.tasty-rerun-log
|
||||
.vscode
|
||||
|
@ -4,6 +4,7 @@ trigger:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
- azure*
|
||||
|
||||
# Enable PR triggers that target the master branch
|
||||
pr:
|
||||
@ -13,187 +14,5 @@ pr:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
- job: ghcide_stack_86
|
||||
timeoutInMinutes: 60
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
steps:
|
||||
- checkout: self
|
||||
- task: CacheBeta@0
|
||||
inputs:
|
||||
key: stack-cache-v2 | $(Agent.OS) | $(Build.SourcesDirectory)/stack.yaml | $(Build.SourcesDirectory)/ghcide.cabal
|
||||
path: .azure-cache
|
||||
cacheHitVar: CACHE_RESTORED
|
||||
displayName: "Cache stack artifacts"
|
||||
- bash: |
|
||||
mkdir -p ~/.stack
|
||||
tar xzf .azure-cache/stack-root.tar.gz -C $HOME
|
||||
displayName: "Unpack cache"
|
||||
condition: eq(variables.CACHE_RESTORED, 'true')
|
||||
- bash: |
|
||||
./fmt.sh
|
||||
displayName: "HLint via ./fmt.sh"
|
||||
- bash: |
|
||||
sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev
|
||||
if ! which stack >/dev/null 2>&1; then
|
||||
curl -sSL https://get.haskellstack.org/ | sh
|
||||
fi
|
||||
displayName: 'Install Stack'
|
||||
- bash: stack setup
|
||||
displayName: 'stack setup'
|
||||
- bash: stack build --only-dependencies
|
||||
displayName: 'stack build --only-dependencies'
|
||||
- bash: stack test --ghc-options=-Werror || stack test --ghc-options=-Werror || stack test --ghc-options=-Werror
|
||||
# ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
|
||||
displayName: 'stack test --ghc-options=-Werror'
|
||||
- bash: |
|
||||
mkdir -p .azure-cache
|
||||
tar czf .azure-cache/stack-root.tar.gz -C $HOME .stack
|
||||
displayName: "Pack cache"
|
||||
- bash: |
|
||||
set -euo pipefail
|
||||
MESSAGE=$(git log --pretty=format:%s -n1)
|
||||
curl -XPOST \
|
||||
-i \
|
||||
-H 'Content-type: application/json' \
|
||||
--data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/ghcide/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
|
||||
$(Slack.URL)
|
||||
condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master'))
|
||||
- job: ghcide_stack_84
|
||||
timeoutInMinutes: 60
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
steps:
|
||||
- checkout: self
|
||||
- task: CacheBeta@0
|
||||
inputs:
|
||||
key: stack-cache-v2 | $(Agent.OS) | $(Build.SourcesDirectory)/stack84.yaml | $(Build.SourcesDirectory)/ghcide.cabal
|
||||
path: .azure-cache
|
||||
cacheHitVar: CACHE_RESTORED
|
||||
displayName: "Cache stack artifacts"
|
||||
- bash: |
|
||||
mkdir -p ~/.stack
|
||||
tar xzf .azure-cache/stack-root.tar.gz -C $HOME
|
||||
displayName: "Unpack cache"
|
||||
condition: eq(variables.CACHE_RESTORED, 'true')
|
||||
- bash: |
|
||||
./fmt.sh
|
||||
displayName: "HLint via ./fmt.sh"
|
||||
- bash: |
|
||||
sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev
|
||||
if ! which stack >/dev/null 2>&1; then
|
||||
curl -sSL https://get.haskellstack.org/ | sh
|
||||
fi
|
||||
displayName: 'Install Stack'
|
||||
- bash: stack setup --stack-yaml=stack84.yaml
|
||||
displayName: 'stack setup --stack-yaml=stack84.yaml'
|
||||
- bash: stack build --only-dependencies --stack-yaml=stack84.yaml
|
||||
displayName: 'stack build --only-dependencies --stack-yaml=stack84.yaml'
|
||||
- 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
|
||||
# ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
|
||||
displayName: 'stack test --stack-yaml=stack84.yaml --ghc-options=-Werror'
|
||||
- bash: |
|
||||
mkdir -p .azure-cache
|
||||
tar czf .azure-cache/stack-root.tar.gz -C $HOME .stack
|
||||
displayName: "Pack cache"
|
||||
- bash: |
|
||||
set -euo pipefail
|
||||
MESSAGE=$(git log --pretty=format:%s -n1)
|
||||
curl -XPOST \
|
||||
-i \
|
||||
-H 'Content-type: application/json' \
|
||||
--data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/ghcide/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
|
||||
$(Slack.URL)
|
||||
condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master'))
|
||||
- job: ghcide_stack_88
|
||||
timeoutInMinutes: 60
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
steps:
|
||||
- checkout: self
|
||||
- task: CacheBeta@0
|
||||
inputs:
|
||||
key: stack-cache-v2 | $(Agent.OS) | $(Build.SourcesDirectory)/stack88.yaml | $(Build.SourcesDirectory)/ghcide.cabal
|
||||
path: .azure-cache
|
||||
cacheHitVar: CACHE_RESTORED
|
||||
displayName: "Cache stack artifacts"
|
||||
- bash: |
|
||||
mkdir -p ~/.stack
|
||||
tar xzf .azure-cache/stack-root.tar.gz -C $HOME
|
||||
displayName: "Unpack cache"
|
||||
condition: eq(variables.CACHE_RESTORED, 'true')
|
||||
- bash: |
|
||||
./fmt.sh
|
||||
displayName: "HLint via ./fmt.sh"
|
||||
- bash: |
|
||||
sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev
|
||||
if ! which stack >/dev/null 2>&1; then
|
||||
curl -sSL https://get.haskellstack.org/ | sh
|
||||
fi
|
||||
displayName: 'Install Stack'
|
||||
- bash: stack setup --stack-yaml=stack88.yaml
|
||||
displayName: 'stack setup --stack-yaml=stack88.yaml'
|
||||
- bash: stack build --only-dependencies --stack-yaml=stack88.yaml
|
||||
displayName: 'stack build --only-dependencies --stack-yaml=stack88.yaml'
|
||||
- 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
|
||||
# ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
|
||||
displayName: 'stack test --stack-yaml=stack88.yaml --ghc-options=-Werror'
|
||||
- bash: |
|
||||
mkdir -p .azure-cache
|
||||
tar czf .azure-cache/stack-root.tar.gz -C $HOME .stack
|
||||
displayName: "Pack cache"
|
||||
- bash: |
|
||||
set -euo pipefail
|
||||
MESSAGE=$(git log --pretty=format:%s -n1)
|
||||
curl -XPOST \
|
||||
-i \
|
||||
-H 'Content-type: application/json' \
|
||||
--data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/ghcide/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
|
||||
$(Slack.URL)
|
||||
condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master'))
|
||||
- job: ghcide_stack_ghc_lib_88
|
||||
timeoutInMinutes: 60
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
steps:
|
||||
- checkout: self
|
||||
- task: CacheBeta@0
|
||||
inputs:
|
||||
key: stack-cache-v2 | $(Agent.OS) | $(Build.SourcesDirectory)/stack-ghc-lib.yaml | $(Build.SourcesDirectory)/ghcide.cabal
|
||||
path: .azure-cache
|
||||
cacheHitVar: CACHE_RESTORED
|
||||
displayName: "Cache stack artifacts"
|
||||
- bash: |
|
||||
mkdir -p ~/.stack
|
||||
tar xzf .azure-cache/stack-root.tar.gz -C $HOME
|
||||
displayName: "Unpack cache"
|
||||
condition: eq(variables.CACHE_RESTORED, 'true')
|
||||
- bash: |
|
||||
./fmt.sh
|
||||
displayName: "HLint via ./fmt.sh"
|
||||
- bash: |
|
||||
sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev
|
||||
if ! which stack >/dev/null 2>&1; then
|
||||
curl -sSL https://get.haskellstack.org/ | sh
|
||||
fi
|
||||
displayName: 'Install Stack'
|
||||
- bash: stack setup --stack-yaml=stack-ghc-lib.yaml
|
||||
displayName: 'stack setup --stack-yaml=stack-ghc-lib.yaml'
|
||||
- bash: stack build --only-dependencies --stack-yaml=stack-ghc-lib.yaml
|
||||
displayName: 'stack build --only-dependencies --stack-yaml=stack-ghc-lib.yaml'
|
||||
- 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
|
||||
# ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
|
||||
displayName: 'stack test --stack-yaml=stack-ghc-lib.yaml --ghc-options=-Werror'
|
||||
- bash: |
|
||||
mkdir -p .azure-cache
|
||||
tar czf .azure-cache/stack-root.tar.gz -C $HOME .stack
|
||||
displayName: "Pack cache"
|
||||
- bash: |
|
||||
set -euo pipefail
|
||||
MESSAGE=$(git log --pretty=format:%s -n1)
|
||||
curl -XPOST \
|
||||
-i \
|
||||
-H 'Content-type: application/json' \
|
||||
--data "{\"text\":\"<!here> *FAILED* $(Agent.JobName): <https://dev.azure.com/digitalasset/ghcide/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
|
||||
$(Slack.URL)
|
||||
condition: and(failed(), eq(variables['Build.SourceBranchName'], 'master'))
|
||||
- template: ./.azure/linux-stack.yml
|
||||
- template: ./.azure/windows-stack.yml
|
||||
|
Loading…
Reference in New Issue
Block a user