Skip to content

Commit b902531

Browse files
Simplify log-disk-space action to just df -h
The du commands scan the entire filesystem, taking ~1m45s per call. Replace with just 'df -h' which returns instantly. Remove the detailed input option and its callers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 457ca11 commit b902531

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,13 @@ jobs:
7575

7676
- name: Log disk space (after externals cache restore)
7777
uses: ./.github/workflows/log-disk-space
78-
with:
79-
detailed: 'true'
8078

8179
- name: Run dotnet cake
8280
run: dotnet cake
8381
continue-on-error: true
8482

8583
- name: Log disk space (after dotnet cake)
8684
uses: ./.github/workflows/log-disk-space
87-
with:
88-
detailed: 'true'
8985

9086
# Save the externals cache after dotnet cake runs
9187
# This ensures the cache reflects the original config.json state
Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
name: Log Disk Space
22
description: Logs disk space usage on the runner
3-
inputs:
4-
detailed:
5-
description: 'Whether to include detailed disk analysis (true/false)'
6-
required: false
7-
default: 'false'
83
runs:
94
using: composite
105
steps:
@@ -13,48 +8,3 @@ runs:
138
run: |
149
echo "=== Disk Space Usage ==="
1510
df -h
16-
echo ""
17-
echo "=== Disk Usage by Directory (/) ==="
18-
du -h -d 1 / 2>/dev/null | sort -hr | head -20 || true
19-
echo ""
20-
echo "=== Disk Usage in Current Directory ==="
21-
du -h -d 1 . 2>/dev/null | sort -hr | head -20 || true
22-
echo ""
23-
echo "=== Disk Usage Summary ==="
24-
df -h / | tail -1 | awk '{print "Used: " $3 " / " $2 " (" $5 " full)"}'
25-
26-
# Detailed analysis if requested
27-
if [ "${{ inputs.detailed }}" = "true" ]; then
28-
echo ""
29-
echo "=== DETAILED ANALYSIS ==="
30-
echo ""
31-
echo "=== Largest directories in /home/runner ==="
32-
sudo du -h /home/runner 2>/dev/null | sort -rh | head -20
33-
echo ""
34-
echo "=== Largest directories in /opt ==="
35-
sudo du -h /opt 2>/dev/null | sort -rh | head -20
36-
echo ""
37-
echo "=== Workspace breakdown (top level) ==="
38-
du -h --max-depth=1 . 2>/dev/null | sort -rh
39-
echo ""
40-
echo "=== Workspace breakdown (2 levels deep) ==="
41-
du -h --max-depth=2 . 2>/dev/null | sort -rh | head -30
42-
echo ""
43-
echo "=== externals directory ==="
44-
du -sh ./externals/* 2>/dev/null | sort -rh | head -20 || echo "No externals"
45-
echo ""
46-
echo "=== output directory ==="
47-
du -sh ./output/* 2>/dev/null | sort -rh | head -20 || echo "No output"
48-
echo ""
49-
echo "=== generated directory ==="
50-
du -sh ./generated/* 2>/dev/null | sort -rh | head -20 || echo "No generated"
51-
echo ""
52-
echo "=== /mnt disk usage ==="
53-
du -h --max-depth=1 /mnt 2>/dev/null | sort -rh
54-
echo ""
55-
echo "=== Docker usage ==="
56-
docker system df 2>/dev/null || echo "Docker not available"
57-
echo ""
58-
echo "=== Temp directories ==="
59-
du -sh /tmp /var/tmp 2>/dev/null || true
60-
fi

0 commit comments

Comments
 (0)