From 72c455a4a1d2dbeeed9c9d4e80cf333bdf98fcf2 Mon Sep 17 00:00:00 2001
From: Matthew Pickering <matthewtpickering@gmail.com>
Date: Sun, 10 Mar 2019 17:54:59 +0000
Subject: [PATCH] CI: Add ghc-in-ghci build job

This is a separate build job to the other hadrian jobs as it only takes
about 2-3 minutes to run from cold. The CI tests that the
`./hadrian/ghci` script loads `ghc/Main.hs` successfully.
---
 .gitlab-ci.yml | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f1f5550663b4..13e9d8e7810a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -85,6 +85,32 @@ validate-x86_64-linux-deb8-hadrian:
   tags:
     - x86_64-linux
 
+hadrian-ghc-in-ghci:
+  stage: build
+  image: ghcci/x86_64-linux-deb8:0.1
+  before_script:
+    # workaround for docker permissions
+    - sudo chown ghc:ghc -R .
+    - python3 .gitlab/fix-submodules.py
+    - git submodule sync --recursive
+    - git submodule update --init --recursive
+    - git checkout .gitmodules
+  tags:
+    - x86_64-linux
+  script:
+    - cabal update
+    - git clean -xdf && git submodule foreach git clean -xdf
+    - bash .circleci/prepare-system.sh
+    - if [[ -d ./cabal-cache ]]; then cp -R ./.cabal-cache ~/.cabal-cache; fi
+    - ./boot
+    - ./configure $CONFIGURE_ARGS
+    # Load ghc-in-ghci then immediately exit
+    - echo ":q" | hadrian/ghci.sh
+  cache:
+    key: hadrian-ghci
+    paths:
+      - cabal-cache
+
 ############################################################
 # Validation via Pipelines (make)
 ############################################################
-- 
GitLab