Commit 5b4e95c6 authored by Edward Z. Yang's avatar Edward Z. Yang Committed by Edward Z. Yang
Browse files

Retry when running Appveyor to work around failures.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent a1d9e88d
@echo off
rem Source: https://github.com/appveyor/ci/blob/master/scripts/appveyor-retry.cmd
rem initiate the retry number
set retryNumber=0
set maxRetries=3
:RUN
%*
set LastErrorLevel=%ERRORLEVEL%
IF %LastErrorLevel% == 0 GOTO :EOF
set /a retryNumber=%retryNumber%+1
IF %reTryNumber% == %maxRetries% (GOTO :FAILED)
:RETRY
set /a retryNumberDisp=%retryNumber%+1
@echo Command "%*" failed with exit code %LastErrorLevel%. Retrying %retryNumberDisp% of %maxRetries%
GOTO :RUN
: FAILED
@echo Sorry, we tried running command for %maxRetries% times and all attempts were unsuccessful!
EXIT /B %LastErrorLevel%
......@@ -16,7 +16,7 @@ build_script:
# 'echo "" |' works around an AppVeyor issue:
# https://github.com/commercialhaskell/stack/issues/1097#issuecomment-145747849
- echo "" | ..\cabal install --only-dependencies --enable-tests
- echo "" | ..\appveyor-retry ..\cabal install --only-dependencies --enable-tests
- Setup configure --user --ghc-option=-Werror --enable-tests
- Setup build
......@@ -27,7 +27,7 @@ build_script:
# - echo "" | ..\cabal install hackage-repo-tool --allow-newer=Cabal,time --constraint="Cabal == 1.25.0.0"
- cd ..\cabal-testsuite
- ghc --make -threaded -i Setup.hs -package Cabal-1.25.0.0
- echo "" | ..\cabal install --only-dependencies --enable-tests
- echo "" | ..\appveyor-retry ..\cabal install --only-dependencies --enable-tests
- Setup configure --user --ghc-option=-Werror --enable-tests
- Setup build
# Must install the test suite, so that our GHCi invocation picks it up
......@@ -39,8 +39,8 @@ build_script:
# - Setup test --show-details=streaming --test-option=--hide-successes
- cd ..\cabal-install
- ghc --make -threaded -i -i. Setup.hs -Wall -Werror
- echo "" | ..\cabal install happy
- echo "" | ..\cabal install --only-dependencies --enable-tests
- echo "" | ..\appveyor-retry ..\cabal install happy
- echo "" | ..\appveyor-retry ..\cabal install --only-dependencies --enable-tests
- ..\cabal configure --user --ghc-option=-Werror --enable-tests
- ..\cabal build
# update package index again, this time for the cabal under test
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment