Skip to content
Snippets Groups Projects
Commit 9be2e5b3 authored by Georges Racinet's avatar Georges Racinet
Browse files

CI/CD RHGitaly: using artifacts and cache

This artifacts built by `tests-rust` will serve as precompilation
for gitaly-comparison.

For the cache, we follow the instructions of
https://doc.rust-lang.org/nightly/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
but still exclude installed binaries information

Hopefully, this will speed up the build a bit.
parent 862e93be
No related branches found
No related tags found
3 merge requests!151heptapod#743: making 0.36 the new stable,!144RHGitaly: implement CommitService.ListCommitsByOid,!140Bootstrapping RHGitaly
......@@ -10,6 +10,7 @@
BASE_IMAGES_MERCURIAL: $BASE_IMAGES_COLLECTION/mercurial
# good enough for now, will have to depend on branch at some point:
MERCURIAL_RUST_DEP_REVISION: default
CARGO_HOME: ${CI_PROJECT_DIR}/cargo_home
check-sdist:
......@@ -50,6 +51,16 @@
script:
- ./run-all-tests
.cargo-cache:
cache:
key: cargo-${CI_COMMIT_HG_BRANCH}
paths:
# not caching bin/ nor .crates files as these are for installed binaries
# and should be treated as artifacts instead
- ${CARGO_HOME}/registry/index/
- ${CARGO_HOME}/registry/cache/
- ${CARGO_HOME}/git/db/
tests-rust:
stage: main
image: ${BASE_IMAGES_COLLECTION}/hgitaly-rust:${CI_COMMIT_HG_BRANCH}
......@@ -53,6 +64,9 @@
tests-rust:
stage: main
image: ${BASE_IMAGES_COLLECTION}/hgitaly-rust:${CI_COMMIT_HG_BRANCH}
extends: .cargo-cache
cache:
policy: pull-push
script:
- ci/prepare-rhgitaly
- cargo test --manifest-path rust/Cargo.toml
......@@ -56,6 +70,10 @@
script:
- ci/prepare-rhgitaly
- cargo test --manifest-path rust/Cargo.toml
artifacts:
expire_in: 1d
paths:
- rust/target
tests-hg-current:
variables:
......@@ -68,6 +86,9 @@
gitaly-comparison:
extends:
- .pytests
- .cargo-cache
cache:
policy: pull
stage: compat
image: ${BASE_IMAGES_COLLECTION}/heptapod-gitaly:${CI_COMMIT_HG_BRANCH}
variables:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment