gitlabci: Improve caching

This commit is contained in:
Jordan Petridis 2018-03-18 05:59:35 +02:00
parent 327c907463
commit 2457e95f0e
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6

View File

@ -13,6 +13,11 @@ stages:
before_script:
- apt-get update -yqq
- apt-get install -yqq --no-install-recommends build-essential libgtk-3-dev meson
- mkdir -p .cargo_cache
# Only stuff inside the repo directory can be cached
# Override the CARGO_HOME variable to force it location
- export CARGO_HOME="${PWD}/.cargo_cache"
script:
- rustc -Vv && cargo -Vv
# Force regeneration of gresources regardless of artifacts chage
@ -21,6 +26,14 @@ stages:
- 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-$CI_COMMIT_REF_SLUG"
paths:
- target/
- .cargo_cache/
stable:test:
# https://hub.docker.com/_/rust/
@ -50,6 +63,7 @@ flatpak:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .flatpak-builder/cache/
- target/
# Configure and run rustfmt on nightly
# Exits and builds fails if on bad format