# Run tests
if [[ "$(uname)" = "Darwin" ]]; then
    timeout_cmd="gtimeout"
else
    timeout_cmd="timeout"
fi
$timeout_cmd 15m stack --no-terminal --jobs=2 --install-ghc --system-ghc build --only-dependencies --fast
ret=$?
case "$ret" in
    0)
    # continue
    ;;
    124)
        echo "Timed out while installing dependencies."
        echo "Try building again by pushing a new commit."
        exit 1
        ;;
    *)
        echo "Failed to install dependencies; stack exited with $ret"
        exit "$ret"
        ;;
esac

# Run tests
if [[ "$(uname)" = "Darwin" ]]; then
    timeout_cmd="gtimeout"
else
    timeout_cmd="timeout"
fi
$timeout_cmd 30m stack --no-terminal --jobs=2 --install-ghc --system-ghc build --only-dependencies --fast
ret=$?
case "$ret" in
    0)
    # continue
    ;;
    124)
        echo "Timed out while installing dependencies."
        echo "Try building again by pushing a new commit."
        exit 0
        ;;
    *)
        echo "Failed to install dependencies; stack exited with $ret"
        exit "$ret"
        ;;
esac

--- 
+++ 
@@ -4,7 +4,7 @@
 else
     timeout_cmd="timeout"
 fi
-$timeout_cmd 30m stack --no-terminal --jobs=2 --install-ghc --system-ghc build --only-dependencies --fast
+$timeout_cmd 15m stack --no-terminal --jobs=2 --install-ghc --system-ghc build --only-dependencies --fast
 ret=$?
 case "$ret" in
     0)
@@ -13,7 +13,7 @@
     124)
         echo "Timed out while installing dependencies."
         echo "Try building again by pushing a new commit."
-        exit 0
+        exit 1
         ;;
     *)
         echo "Failed to install dependencies; stack exited with $ret"
Revert "revert this patch once the mac builder is working"

This reverts commit f16747624b1dba1e6ddc2743e08841f25f03bfea.
