From 79239a2e01ac2b7d2f14553d80298ae16f59afdb Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Wed, 16 May 2018 20:56:35 +0300 Subject: [PATCH] gitlabci: Cache cargo for the clippy job. --- .gitlab-ci.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20328fb..90453f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,16 @@ stages: variables: BUNDLE: "hammond-dev.flatpak" +.cargo_cache_template: &cargo_cache + cache: + # JOB_NAME - Each job will have it's own cache + # COMMIT_REF_SLUG = Lowercase name of the branch + # ^ Keep diffrerent caches for each branch + key: "$CI_JOB_NAME" + paths: + - target/ + - .cargo_cache/ + .cargo_test_template: &cargo_test stage: test @@ -29,15 +39,7 @@ variables: - cargo build - cargo test -- --test-threads=1 - cargo test -- --test-threads=1 --ignored - - cache: - # JOB_NAME - Each job will have it's own cache - # COMMIT_REF_SLUG = Lowercase name of the branch - # ^ Keep diffrerent caches for each branch - key: "$CI_JOB_NAME" - paths: - - target/ - - .cargo_cache/ + <<: *cargo_cache .rust:stable: # https://hub.docker.com/_/rust/ @@ -137,4 +139,5 @@ clippy: - cargo clippy --version # Force regeneration of gresources regardless of artifacts chage - cd hammond-gtk/resources/ && glib-compile-resources --generate resources.xml && cd ../../ - - cargo clippy --all \ No newline at end of file + - cargo clippy --all + <<: *cargo_cache \ No newline at end of file