diff options
Diffstat (limited to '.circleci')
-rw-r--r-- | .circleci/config.yml | 25 | ||||
-rwxr-xr-x | .circleci/tickle.sh | 24 |
2 files changed, 49 insertions, 0 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..8aaf463 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,25 @@ +version: 2 +jobs: + build: + docker: + - image: 'fpco/stack-build:latest' + steps: + - checkout + - restore_cache: + key: 'v1-hakyll-{{ arch }}-{{ .Branch }}' + - run: + name: 'Update cabal indices' + command: 'cabal update' + - run: + # We set jobs to 1 here because that prevents Out-Of-Memory exceptions + # while compiling dependencies. + name: 'Install dependencies' + command: '.circleci/tickle.sh cabal install --only-dependencies --enable-tests --jobs=1' + - run: + name: 'Build and run tests' + command: 'cabal test' + - save_cache: + key: 'v1-hakyll-{{ arch }}-{{ .Branch }}-{{ .Revision }}' + paths: + - '~/.cabal' + - '~/.ghc' diff --git a/.circleci/tickle.sh b/.circleci/tickle.sh new file mode 100755 index 0000000..5071bb4 --- /dev/null +++ b/.circleci/tickle.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -o nounset -o errexit -o pipefail + +function tickle() { + while [ true ]; do + echo "[$(date +%H:%M:%S)"] Tickling... + sleep 60 + done +} + +echo "Forking tickle process..." +tickle & +TICKLE_PID=$! + +echo "Forking build process..." +eval $@ & +BUILD_PID=$! + +echo "Waiting for build thread ($BUILD_PID)..." +wait $BUILD_PID + +echo "Killing tickle thread ($TICKLE_PID)..." +kill $TICKLE_PID +echo "All done!" |