Why the hell you do not cache cargo.

This commit is contained in:
Jordan Petridis 2018-03-19 07:43:04 +02:00
parent 1af06f2e0d
commit c2a3ce5096
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6

View File

@ -2,7 +2,6 @@ stages:
- test - test
- lint - lint
.cargo_test_template: &cargo_test .cargo_test_template: &cargo_test
stage: test stage: test
@ -17,7 +16,7 @@ stages:
- mkdir -p .cargo_cache - mkdir -p .cargo_cache
# Only stuff inside the repo directory can be cached # Only stuff inside the repo directory can be cached
# Override the CARGO_HOME variable to force it location # Override the CARGO_HOME variable to force it location
- export CARGO_HOME=".cargo_cache" - export CARGO_HOME="${PWD}/.cargo_cache"
script: script:
- rustc -Vv && cargo -Vv - rustc -Vv && cargo -Vv
# Force regeneration of gresources regardless of artifacts chage # Force regeneration of gresources regardless of artifacts chage
@ -26,14 +25,15 @@ stages:
- cargo build - cargo build
- cargo test -- --test-threads=1 - cargo test -- --test-threads=1
- cargo test -- --test-threads=1 --ignored - cargo test -- --test-threads=1 --ignored
cache: cache:
# JOB_NAME - Each job will have it's own cache # JOB_NAME - Each job will have it's own cache
# COMMIT_REF_SLUG = Lowercase name of the branch # COMMIT_REF_SLUG = Lowercase name of the branch
# ^ Keep diffrerent caches for each branch # ^ Keep diffrerent caches for each branch
key: "$CI_JOB_NAME" key: "$CI_JOB_NAME"
paths: paths:
- target/ - target/
- .cargo_cache/ - .cargo_cache/
stable:test: stable:test:
# https://hub.docker.com/_/rust/ # https://hub.docker.com/_/rust/