Improve incremental speed of docker cargo builds outside of CI

This commit is contained in:
Michael Vines 2018-08-28 20:54:05 -07:00
parent 399caf343c
commit c81c19234f
1 changed files with 6 additions and 1 deletions

View File

@ -34,9 +34,14 @@ ARGS=(
)
if [[ -n $CI ]]; then
# Share the real ~/.cargo between docker containers in CI for speed
ARGS+=(--volume "$HOME:/home")
ARGS+=(--env "CARGO_HOME=/home/.cargo")
else
# Avoid sharing ~/.cargo when building locally to avoid a mixed macOS/Linux
# ~/.cargo
ARGS+=(--volume "$PWD:/home")
fi
ARGS+=(--env "CARGO_HOME=/home/.cargo")
# kcov tries to set the personality of the binary which docker
# doesn't allow by default.