Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions .github/workflows/tests-rs-workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,27 @@ jobs:
with:
clean: false

- name: Clean target if too large
- name: Prune macOS runner disk before tests
run: |
SIZE=$(du -sm target 2>/dev/null | cut -f1 || true)
for path in ../target-backup-before-*-clean-* target/llvm-cov-target; do
if [ -e "$path" ]; then
echo "Removing stale runner artifact: $path"
rm -rf "$path"
fi
done

TARGET_MAX_MB=120000
MIN_FREE_MB=60000
SIZE=$(du -sm target 2>/dev/null | awk '{print $1}' || echo 0)
FREE=$(df -m . | awk 'NR == 2 {print $4}')
SIZE=${SIZE:-0}
FREE=${FREE:-0}

echo "target/ size: ${SIZE}MB"
if [ "$SIZE" -gt 200000 ]; then
echo "target/ exceeds 200GB — cleaning"
cargo clean
echo "available disk: ${FREE}MB"
if [ "$SIZE" -gt "$TARGET_MAX_MB" ] || [ "$FREE" -lt "$MIN_FREE_MB" ]; then
echo "target/ exceeds ${TARGET_MAX_MB}MB or disk is below ${MIN_FREE_MB}MB free; removing target/"
rm -rf target
fi

- name: Install build dependencies
Expand Down Expand Up @@ -212,6 +225,15 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false

- name: Remove cargo-llvm-cov build artifacts
if: always()
run: |
if [ -d target/llvm-cov-target ]; then
du -sh target/llvm-cov-target || true
rm -rf target/llvm-cov-target
fi
du -sh target 2>/dev/null || true

- name: Run doctests
if: ${{ inputs.doctests-changed }}
run: |
Expand Down Expand Up @@ -530,4 +552,3 @@ jobs:
fi
done
echo "No immutable/append_only structure violations found"

Loading