Skip to content

Commit 5351922

Browse files
[copilot] mount directories, more logging (#1301)
Merging to test on other pull requests.
1 parent 053c1b6 commit 5351922

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,22 @@ jobs:
1313
- name: Log disk space (after checkout)
1414
uses: ./.github/workflows/log-disk-space
1515

16+
- name: Setup build directories on secondary disk
17+
run: |
18+
echo "Setting up build directories on /mnt (secondary disk with 66G+ free)"
19+
mkdir -p /mnt/build-output
20+
mkdir -p /mnt/externals
21+
mkdir -p /mnt/generated
22+
23+
# Create symlinks to use the secondary disk
24+
ln -s /mnt/build-output ./output
25+
ln -s /mnt/externals ./externals-link
26+
ln -s /mnt/generated ./generated-link
27+
28+
echo "Build directories configured:"
29+
ls -la | grep -E "(output|externals|generated)"
30+
df -h /mnt
31+
1632
- name: Setup .NET
1733
uses: actions/setup-dotnet@v4
1834
with:
@@ -54,13 +70,17 @@ jobs:
5470

5571
- name: Log disk space (after externals cache restore)
5672
uses: ./.github/workflows/log-disk-space
73+
with:
74+
detailed: 'true'
5775

5876
- name: Run dotnet cake
5977
run: dotnet cake
6078
continue-on-error: true
6179

6280
- name: Log disk space (after dotnet cake)
6381
uses: ./.github/workflows/log-disk-space
82+
with:
83+
detailed: 'true'
6484

6585
# Save the externals cache after dotnet cake runs
6686
# This ensures the cache reflects the original config.json state

.github/workflows/log-disk-space/action.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
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'
38
runs:
49
using: composite
510
steps:
@@ -17,3 +22,39 @@ runs:
1722
echo ""
1823
echo "=== Disk Usage Summary ==="
1924
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)