diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f935c81..95cb5f6e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -169,7 +169,20 @@ clippy: needs: [fmt] variables: SKIP_WASM_BUILD: "1" - timeout: 2h + # Use pre-baked registry in the CI image instead of re-downloading all + # crates on every run (global CARGO_HOME=$CI_PROJECT_DIR/.cargo is wiped). + CARGO_HOME: /root/.cargo + timeout: 3h + before_script: + - rustup show + - rustc --version && cargo --version + - rustup target add wasm32v1-none + - export CACHE_KEY="$(cat Cargo.lock rust-toolchain.toml | md5sum | cut -c1-12)" + - export CARGO_TARGET_DIR="/cache/cargo-target/${CACHE_KEY}/clippy" + - mkdir -p "$CARGO_TARGET_DIR" + - find /cache/cargo-target -mindepth 1 -maxdepth 1 -type d ! -name "${CACHE_KEY}" -exec rm -rf {} + 2>/dev/null || true + - echo "CARGO_TARGET_DIR=$CARGO_TARGET_DIR (disk $(df -h /cache/cargo-target | tail -1 | awk '{print $3 "/" $2 " used, " $4 " free"}'))" + cache: [] script: - git config --global --add safe.directory '*' - |