From 8b2d6bd9767761db0ce3e409096f2459c5670af0 Mon Sep 17 00:00:00 2001
From: Ralf Jung <post@ralfj.de>
Date: Thu, 3 Nov 2016 19:11:55 +0100
Subject: [PATCH] update CI: rely on runner not cleaning submodules to cache
 Iris

---
 .gitlab-ci.yml | 34 ++++++++++++++++++++++------------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index daf4fcd0..c9e18f52 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,22 +1,32 @@
 image: coq:8.5
 
-buildjob:
+stages:
+  - iris
+  - lrust
+
+iris:
+  stage: iris
+  tags:
+  - coq
+  script:
+  - coqc -v
+  # see if the Iris submodule needs cleaning, then build it
+  - 'git submodule status iris | egrep "^ " || (git submodule update --init iris && cd iris && git clean -xfd)'
+  - 'cd iris && make -j8'
+  only:
+  - master
+  - ci
+
+lrust:
+  stage: lrust
   tags:
   - coq
   script:
   - coqc -v
-  - 'export IRIS_SHA=$(git submodule status iris | sed "s/^.\([a-f0-9]*\) .*$/\1/")'
-  # see if we have sth. in the cache, otherwise build Iris
-  - '[ -d iris-cache/$IRIS_SHA ] && ln -sv iris-cache/$IRIS_SHA iris-enabled'
-  - '[ -d iris-enabled ] || make iris-local -j8'
+  # prepare the environment
+  - 'ln -s iris iris-enabled'
   # build local repo
   - 'time make -j8'
-  # cache Iris
-  - mkdir -p iris-cache
-  - '[ -d iris-cache/$IRIS_SHA ] || cp -a iris iris-cache/$IRIS_SHA'
-  cache:
-    key: "lrust"
-    paths:
-    - iris-cache/
   only:
   - master
+  - ci
-- 
GitLab