From 4127425f6bc9707c3bdf7af14105bc24662612c9 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Mon, 8 Oct 2018 11:47:44 +0300 Subject: [PATCH] CI: Cache the cargo registry --- .gitlab-ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be10b22bd..3d99bd635 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,12 @@ stages: - "test" +.cargo_cache: &cache + cache: + key: "gst" + paths: + - ".cargo_cache/" + .cargo_test_template: &cargo_test stage: "test" variables: @@ -16,9 +22,15 @@ stages: libgl1-mesa-glx libwayland-egl1-mesa + <<: *cache before_script: - apt-get update -yqq - apt-get install -yqq --no-install-recommends $DEPENDENCIES + + # Only stuff inside the repo directory can be cached + # Override the CARGO_HOME variable to force its location + - export CARGO_HOME="${PWD}/.cargo_cache" + - mkdir -p precompiled-gst && cd precompiled-gst - curl -L https://people.freedesktop.org/~slomo/gstreamer-1.14.3.tar.gz | tar xz @@ -48,4 +60,3 @@ test nightly: image: "rustlang/rust:nightly-slim" allow_failure: true <<: *cargo_test -