fix: add cache cleanup step to prevent disk exhaustion in CI

This commit is contained in:
2026-02-12 06:18:45 +03:00
parent 8a22b2a30a
commit c29059b09b
2 changed files with 28 additions and 0 deletions
+14
View File
@@ -38,6 +38,20 @@ jobs:
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4.1.7
# Clean stale caches from other workflows that ran on this VPS runner.
# Each VPS has limited disk; leftover caches from docs/tests can fill it.
- name: Clean stale caches
run: |
echo "Disk before cleanup:"
df -h /cache 2>/dev/null || df -h /
for dir in /cache/cargo-target/*/; do
[ "$dir" = "/cache/cargo-target/pezkuwi-sdk/" ] && continue
echo "Removing stale cache: $dir"
rm -rf "$dir"
done
echo "Disk after cleanup:"
df -h /cache 2>/dev/null || df -h /
- name: Rust Cache
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
with:
+14
View File
@@ -35,6 +35,20 @@ jobs:
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# Clean stale caches from other workflows that ran on this VPS runner.
# Each VPS has limited disk; leftover caches from tests/checks can fill it.
- name: Clean stale caches
run: |
echo "Disk before cleanup:"
df -h /cache 2>/dev/null || df -h /
for dir in /cache/cargo-target/*/; do
[ "$dir" = "/cache/cargo-target/pezkuwi-sdk-docs/" ] && continue
echo "Removing stale cache: $dir"
rm -rf "$dir"
done
echo "Disk after cleanup:"
df -h /cache 2>/dev/null || df -h /
# Exclude pezkuwi-zombienet-sdk-tests: its build.rs runs nested cargo build
# which doesn't inherit workspace [patch.crates-io] settings, causing
# serde_core duplicate lang item error. See: https://github.com/pezkuwichain/pezkuwi-sdk/issues/357