From a72abb1e9fb8ae79a4e8f108f8caea0f64da34c6 Mon Sep 17 00:00:00 2001
From: TriplEight <denis.pisarev@parity.io>
Date: Sun, 28 Apr 2019 11:31:15 +0200
Subject: [PATCH] Update CI (#125)

* ci uses up-to-date builder dockerfile and our new caching

* new dockerfile, probably temporarily, tested.
---
 .gitlab-ci.yml | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 17803163..7f3ce4c7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,24 +2,19 @@ stages:
   - test
   - build
 
-image:                             parity/rust:nightly
+image:                             parity/shasper-ci:stretch
 
 variables:
-  CI_SERVER_NAME:                  "GitLab CI"
-  CARGO_HOME:                      "${CI_PROJECT_DIR}/.cargo"
+  GIT_STRATEGY:                    fetch
+  GIT_SUBMODULE_STRATEGY:          recursive
   RUST_TOOLCHAIN:                  "stable"
-  GIT_SUBMODULE_STRATEGY:          "recursive"
-
-cache:
-  key:                             "${CI_JOB_NAME}"
-  paths:
-    - ./target/
-    - ./.cargo/
-
+  CI_SERVER_NAME:                  "GitLab CI"
+  CARGO_HOME:                      "/ci-cache/shasper/cargo/${CI_JOB_NAME}"
+  SCCACHE_CACHE_SIZE:              50G
 
 before_script:
+  - sccache -s
   - ./scripts/init.sh
-  - export PATH="${CI_PROJECT_DIR}/cargo/bin/:$PATH"
   - ./scripts/build.sh
 
 
@@ -29,6 +24,7 @@ test-rust-stable:
   stage:                           test
   script:
     - time cargo test --all --release --locked
+    - sccache -s
   only:
     - triggers
     - tags
@@ -37,7 +33,7 @@ test-rust-stable:
     - web
     - /^[0-9]+$/
   tags:
-    - rust-stable
+    - linux-docker
 
 
 #### stage:                        build
@@ -45,9 +41,10 @@ test-rust-stable:
 build-linux:
   stage:                           build
   script:
-    - cargo build --release
+    - time cargo build --release
+    - sccache -s
   tags:
-    - rust-stable
+    - linux-docker
   only:
     - master
     - tags
-- 
GitLab