From ec802c90c0b64c8803f1da7510ac23cdbc6223a6 Mon Sep 17 00:00:00 2001
From: Hans-Peter Deifel <hpd@hpdeifel.de>
Date: Tue, 19 Jun 2018 15:33:05 +0200
Subject: [PATCH] ci: Enable caching of stack artifacts

This should reduce the build time in CI drastically.
---
 .gitlab-ci.yml | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b525f60..85db247 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,13 @@
 image: haskell:8.2
 
+# Change stacks global directory to be inside the project directory,
+# since we can only cache local dependencies.
+variables:
+  STACK_ROOT: "$CI_PROJECT_DIR/.stack-root"
+
+cache:
+  paths:
+    - .stack-root/
+
 test:
   script: stack --no-terminal --system-ghc --no-install-ghc build --test --haddock --no-haddock-deps
-- 
GitLab