Context
I have a Rust project with a CI set as follow:
- Job 1
rust_build
: I build the project and cache the generated artifacts. - Job 2
rust_test
: I download the cache (hence, the artifacts in thetarget/
dir), then I runcargo llvm-cov
to run tests and generate a report.
Problem
My problem is that the rust_test
job retriggers a full compilation, I hoped to leverage the already generated artifacts from rust_build
previous job and spare me a huge time.
Attempts
- I tried to copy generated artifacts into
target/llvm-cov-target
- I also tried to set-up the
CARGO_LLVM_COV_TARGET_DIR
environment variable directly totarget/
that contains all artifacts from previouscargo build
(See Environment variables - cargo-llvm-cov), without success.
I may be missing the whole point, maybe cargo llvm-cov
needs to recompile to work properly but I couldn't find anything.
Is there a solution to use already compiled artifacts to spare some compilation time with cargo-llvm-cov
?