Skip to content

Commit e0831ca

Browse files
Clean unused native builds when building for Alpine containers
1 parent f3838b2 commit e0831ca

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,27 @@ jobs:
195195
fail-on-cache-miss: true
196196
enableCrossOsArchive: true
197197

198+
# To avoid disk space issues on the alpine containers, we clean unused native builds
199+
- name: Clean up unused native builds
200+
if: ${{ contains(matrix.container.image, 'alpine') }}
201+
run: |
202+
echo "Disk usage before cleanup:"
203+
df -h
204+
echo "Native build sizes:"
205+
du -sh src/Sentry/Platforms/Native/sentry-native/build-* 2>/dev/null || echo "No builds found yet"
206+
207+
# Keep only the current RID's native build, remove all others
208+
if [ "${{ matrix.rid }}" = "linux-musl-x64" ]; then
209+
find src/Sentry/Platforms/Native/sentry-native -type d -name "build-*" ! -name "*musl-x64*" -exec rm -rf {} + || true
210+
elif [ "${{ matrix.rid }}" = "linux-musl-arm64" ]; then
211+
find src/Sentry/Platforms/Native/sentry-native -type d -name "build-*" ! -name "*musl-arm64*" -exec rm -rf {} + || true
212+
fi
213+
214+
echo "Disk usage after cleanup:"
215+
df -h
216+
echo "Remaining native builds:"
217+
ls -lh src/Sentry/Platforms/Native/sentry-native/ 2>/dev/null || echo "Directory not found"
218+
198219
- name: Build Native Dependencies
199220
if: ${{ !matrix.container }}
200221
uses: ./.github/actions/buildnative

0 commit comments

Comments
 (0)