diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a731789..21f09c05 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -375,11 +375,17 @@ cargo-audit: # cargo fingerprinting handles different feature sets within the same dir. - export CARGO_TARGET_DIR="/cache/cargo-target/${CACHE_KEY}/test-release" - mkdir -p "$CARGO_TARGET_DIR" + # Remove dirs with outdated cache keys (e.g. old Cargo.lock) - find /cache/cargo-target -mindepth 1 -maxdepth 1 -type d ! -name "${CACHE_KEY}" -exec rm -rf {} + 2>/dev/null || true + # Remove other job dirs within the SAME cache key — keeps only test-release. + # Previous per-job dirs (test-partition-1, test-no-try-runtime-2, …) accumulate + # and fill the /cache volume. One shared dir is all we need. + - find /cache/cargo-target/"${CACHE_KEY}" -mindepth 1 -maxdepth 1 -type d ! -name "test-release" -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: [] - # 300m: cold release build on VPS (jemalloc+rocksdb C compilation) can take 3h+. - # Warm cache (second run on same runner) completes in ~30m. + # 300m: cold debug build on VPS can still take 2-3h (first run after cache change). + # Warm cache completes in ~45m. Debug mode compiles 2-3x faster than --release + # while -Cdebug-assertions=y (set in RUSTFLAGS) keeps the same assertion coverage. timeout: 300m retry: max: 1 @@ -398,7 +404,7 @@ test-partition-1: - git config --global --add safe.directory '*' - | cargo nextest run \ - --workspace --locked --release --no-fail-fast --cargo-quiet \ + --workspace --locked --no-fail-fast --cargo-quiet \ --features try-runtime,experimental,ci-only-tests \ --partition count:1/3 artifacts: @@ -414,7 +420,7 @@ test-partition-2: - git config --global --add safe.directory '*' - | cargo nextest run \ - --workspace --locked --release --no-fail-fast --cargo-quiet \ + --workspace --locked --no-fail-fast --cargo-quiet \ --features try-runtime,experimental,ci-only-tests \ --partition count:2/3 artifacts: @@ -430,7 +436,7 @@ test-partition-3: - git config --global --add safe.directory '*' - | cargo nextest run \ - --workspace --locked --release --no-fail-fast --cargo-quiet \ + --workspace --locked --no-fail-fast --cargo-quiet \ --features try-runtime,experimental,ci-only-tests \ --partition count:3/3 # First partition also runs runtime-api tests @@ -448,7 +454,7 @@ test-no-try-runtime-1: - git config --global --add safe.directory '*' - | cargo nextest run \ - --workspace --locked --release --no-fail-fast --cargo-quiet \ + --workspace --locked --no-fail-fast --cargo-quiet \ --features experimental,ci-only-tests \ --partition count:1/2 @@ -458,7 +464,7 @@ test-no-try-runtime-2: - git config --global --add safe.directory '*' - | cargo nextest run \ - --workspace --locked --release --no-fail-fast --cargo-quiet \ + --workspace --locked --no-fail-fast --cargo-quiet \ --features experimental,ci-only-tests \ --partition count:2/2 @@ -476,7 +482,9 @@ wasm-check: - export CARGO_TARGET_DIR="/cache/cargo-target/${CACHE_KEY}/${CI_JOB_NAME}" - 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" + # 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 retry: