Skip to content

Commit

Permalink
Skip unnecessary packing of cache artifacts (haskell/ghcide#794)
Browse files Browse the repository at this point in the history
* Skip unnecessary packing (takes 2m) when we had a successful cache hit

* Pack before testing

* Reenable benchmark CI

* Disable Windows CI

Caching is broken and stackage builds fail all the time with timeouts to
casa.fpcomplete.com
  • Loading branch information
pepeiborra authored Sep 14, 2020
1 parent 0ec1e1f commit 8be47ea
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions .azure/linux-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:
- bash: stack setup --stack-yaml=$STACK_YAML
displayName: 'stack setup'
- bash: stack build --bench --only-dependencies --stack-yaml=$STACK_YAML
displayName: 'stack build --only-dependencies'
- bash: |
export PATH=/opt/cabal/bin:$PATH
stack bench --ghc-options=-Werror --stack-yaml=$STACK_YAML
displayName: 'stack bench --ghc-options=-Werror'
displayName: 'stack build --bench --only-dependencies'
- bash: |
mkdir -p .azure-cache
tar czf .azure-cache/stack-root.tar.gz -C $HOME .stack
displayName: "Pack cache"
- bash: |
export PATH=/opt/cabal/bin:$PATH
stack bench --ghc-options=-Werror --stack-yaml=$STACK_YAML
displayName: 'stack bench --ghc-options=-Werror'
- bash: |
cat bench-hist/results.csv
displayName: "cat results"
Expand Down
9 changes: 5 additions & 4 deletions .azure/linux-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ jobs:
displayName: 'stack setup'
- bash: stack build --only-dependencies --stack-yaml=$STACK_YAML
displayName: 'stack build --only-dependencies'
- bash: |
mkdir -p .azure-cache
tar czf .azure-cache/stack-root.tar.gz -C $HOME .stack
displayName: "Pack cache"
condition: eq(variables.CACHE_RESTORED, 'false')
- bash: |
export PATH=/opt/cabal/bin:$PATH
stack test --ghc-options=-Werror --stack-yaml=$STACK_YAML || stack test --ghc-options=-Werror --stack-yaml=$STACK_YAML --ta "--rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true stack test --ghc-options=-Werror --stack-yaml=$STACK_YAML --ta "--rerun"
# 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"
10 changes: 5 additions & 5 deletions .azure/windows-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ jobs:
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 All @@ -63,8 +68,3 @@ jobs:
fi
displayName: 'stack test --ghc-options=-Werror'
# TODO: run test suite when failing tests are fixed or marked as broken. See https://github.com/digital-asset/ghcide/issues/474
- 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"
5 changes: 2 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ pr:

jobs:
- template: ./.azure/linux-stack.yml
- template: ./.azure/windows-stack.yml
# https://github.com/haskell/ghcide/pull/801
# - template: ./.azure/linux-bench.yml
# - template: ./.azure/windows-stack.yml
- template: ./.azure/linux-bench.yml

0 comments on commit 8be47ea

Please sign in to comment.