2019-09-10 16:13:18 +03:00
|
|
|
# Build master commits
|
|
|
|
trigger:
|
|
|
|
batch: false
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
|
|
|
|
|
|
|
# Enable PR triggers that target the master branch
|
|
|
|
pr:
|
|
|
|
autoCancel: true # cancel previous builds on push
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job: ghcide_stack_86
|
|
|
|
timeoutInMinutes: 60
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
- task: CacheBeta@0
|
|
|
|
inputs:
|
|
|
|
key: stack-cache-v1 | $(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')
|
2019-09-10 17:31:43 +03:00
|
|
|
- bash: |
|
|
|
|
./fmt.sh
|
|
|
|
displayName: "HLint via ./fmt.sh"
|
2019-09-10 16:13:18 +03:00
|
|
|
- bash: |
|
|
|
|
sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev
|
|
|
|
curl -sSL https://get.haskellstack.org/ | sh
|
|
|
|
displayName: 'Install Stack'
|
|
|
|
- bash: stack setup
|
|
|
|
displayName: 'stack setup'
|
2019-09-17 09:50:20 +03:00
|
|
|
- bash: stack build --only-dependencies --ghc-options=-Werror
|
2019-09-10 16:13:18 +03:00
|
|
|
displayName: 'stack build --only-dependencies'
|
|
|
|
- bash: stack test || stack test || stack test
|
|
|
|
# ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
|
|
|
|
displayName: 'stack test'
|
2019-09-11 14:32:08 +03:00
|
|
|
- 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-v1 | $(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
|
|
|
|
curl -sSL https://get.haskellstack.org/ | sh
|
|
|
|
displayName: 'Install Stack'
|
2019-09-11 12:25:41 +03:00
|
|
|
- bash: stack setup --stack-yaml=stack84.yaml
|
|
|
|
displayName: 'stack setup --stack-yaml=stack84.yaml'
|
2019-09-17 09:50:20 +03:00
|
|
|
- bash: stack build --only-dependencies --stack-yaml=stack84.yaml --ghc-options=-Werror
|
2019-09-11 12:25:41 +03:00
|
|
|
displayName: 'stack build --only-dependencies --stack-yaml=stack84.yaml'
|
|
|
|
- bash: stack test --stack-yaml=stack84.yaml || stack test --stack-yaml=stack84.yaml || stack test --stack-yaml=stack84.yaml
|
|
|
|
# ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
|
|
|
|
displayName: 'stack test --stack-yaml=stack84.yaml'
|
2019-09-10 16:13:18 +03:00
|
|
|
- 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'))
|
2019-09-16 12:31:09 +03:00
|
|
|
- job: ghcide_stack_ghc_lib_88
|
|
|
|
timeoutInMinutes: 60
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
- task: CacheBeta@0
|
|
|
|
inputs:
|
|
|
|
key: stack-cache-v1 | $(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
|
|
|
|
curl -sSL https://get.haskellstack.org/ | sh
|
|
|
|
displayName: 'Install Stack'
|
|
|
|
- bash: stack setup --stack-yaml=stack-ghc-lib.yaml
|
|
|
|
displayName: 'stack setup --stack-yaml=stack-ghc-lib.yaml'
|
2019-09-17 09:50:20 +03:00
|
|
|
- bash: stack build --only-dependencies --stack-yaml=stack-ghc-lib.yaml --ghc-options=-Werror
|
2019-09-16 12:31:09 +03:00
|
|
|
displayName: 'stack build --only-dependencies --stack-yaml=stack-ghc-lib.yaml'
|
|
|
|
- bash: stack test --stack-yaml=stack-ghc-lib.yaml || stack test --stack-yaml=stack-ghc-lib.yaml || stack test --stack-yaml=stack-ghc-lib.yaml
|
|
|
|
# ghcide stack tests are flaky, see https://github.com/digital-asset/daml/issues/2606.
|
|
|
|
displayName: 'stack test --stack-yaml=stack-ghc-lib.yaml'
|
|
|
|
- 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'))
|