Skip to content

Commit

Permalink
Enable windows ci (haskell/ghcide#808)
Browse files Browse the repository at this point in the history
* Enable windows ci

* Rewrite comments and retry for all ghc versions

* Cache stack dirs directly

* Increase timeout for bench ci build

Co-authored-by: Pepe Iborra <[email protected]>
  • Loading branch information
jneira and pepeiborra authored Sep 15, 2020
1 parent 56596a1 commit cf66387
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .azure/linux-bench.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
jobs:
- job: ghcide_bench_linux
timeoutInMinutes: 60
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-latest'
strategy:
Expand Down
32 changes: 13 additions & 19 deletions .azure/windows-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ jobs:
- 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')
key: stack-root-cache | $(Agent.OS) | $(Build.SourcesDirectory)/$(STACK_YAML) | $(Build.SourcesDirectory)/ghcide.cabal
path: $(STACK_ROOT)
cacheHitVar: STACK_ROOT_CACHE_RESTORED
displayName: "Cache stack root"
- task: Cache@2
inputs:
key: stack-work-cache | $(Agent.OS) | $(Build.SourcesDirectory)/$(STACK_YAML) | $(Build.SourcesDirectory)/ghcide.cabal
path: .stack-work
cacheHitVar: STACK_WORK_CACHE_RESTORED
displayName: "Cache stack work"
- bash: |
./fmt.sh
displayName: "HLint via ./fmt.sh"
Expand All @@ -47,19 +46,14 @@ jobs:
stack install happy --stack-yaml $STACK_YAML
stack install alex --stack-yaml $STACK_YAML
stack install cabal-install --stack-yaml $STACK_YAML
# GHC 8.10 keeps crashing with various kinds of access violations and other
# errors so we retry 3 times.
# GHC 8.10.1 fails with ghc segfaults, using -fexternal-interpreter seems to make it working
# There are other transient errors like timeouts downloading from stackage so we retry 3 times
if [ "$STACK_YAML" = "stack8101.yaml" ]; then
stack build --only-dependencies --stack-yaml $STACK_YAML --ghc-options="-fexternal-interpreter" || stack build --only-dependencies --stack-yaml $STACK_YAML --ghc-options="-fexternal-interpreter" || stack build --only-dependencies --stack-yaml $STACK_YAML --ghc-options="-fexternal-interpreter"
else
stack build --only-dependencies --stack-yaml $STACK_YAML
stack build --only-dependencies --stack-yaml $STACK_YAML || stack build --only-dependencies --stack-yaml $STACK_YAML || stack build --only-dependencies --stack-yaml $STACK_YAML
fi
displayName: 'stack build --only-dependencies'
- 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: |
if [ "$STACK_YAML" = "stack8101.yaml" ]; then
stack test --no-run-tests --ghc-options="-Werror -fexternal-interpreter" --stack-yaml $STACK_YAML || stack test --no-run-tests --ghc-options="-Werror -fexternal-interpreter" --stack-yaml $STACK_YAML || stack test --no-run-tests --ghc-options="-Werror -fexternal-interpreter" --stack-yaml $STACK_YAML
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ pr:

jobs:
- template: ./.azure/linux-stack.yml
# - template: ./.azure/windows-stack.yml
- template: ./.azure/windows-stack.yml
- template: ./.azure/linux-bench.yml

0 comments on commit cf66387

Please sign in to comment.