diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7fb3d5e2..f7353157 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -383,7 +383,10 @@ cargo-audit: needs: [clippy, check-try-runtime] variables: CARGO_HOME: /root/.cargo - RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" + # -Cdebuginfo=1: line tables only — keeps file:line in panics, skips variable + # and type info. Reduces debug binary size by ~60% vs full debug (debuginfo=2). + # On a Substrate workspace this cuts the /cache target dir from 50G → ~20G. + RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings -Cdebuginfo=1" WASM_BUILD_NO_COLOR: "1" CARGO_INCREMENTAL: "0" # Skip WASM runtime builds — unit/integration tests use mock environments @@ -507,11 +510,15 @@ wasm-check: - 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}/${CI_JOB_NAME}" + # Share test-release with all test-partition and test-no-try-runtime jobs. + # wasm32v1-none artifacts land in test-release/wasm32v1-none/ — separate from + # test-release/debug/ — so there is no conflict. Sharing avoids deleting the + # test-release dir mid-pipeline when later test jobs still need it. + - export CARGO_TARGET_DIR="/cache/cargo-target/${CACHE_KEY}/test-release" - mkdir -p "$CARGO_TARGET_DIR" + # Only remove dirs with OUTDATED cache keys (old Cargo.lock/toolchain). + # Never remove the current key's test-release — other jobs may still be queued. - find /cache/cargo-target -mindepth 1 -maxdepth 1 -type d ! -name "${CACHE_KEY}" -exec rm -rf {} + 2>/dev/null || true - # Keep only wasm-check dir; remove test-release and any other stale dirs - - find /cache/cargo-target/"${CACHE_KEY}" -mindepth 1 -maxdepth 1 -type d ! -name "${CI_JOB_NAME}" -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: [] timeout: 2h