mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
In this commit, we significantly expand the cleanup-space GitHub Actions workflow to free up substantially more disk space on GitHub runners. The previous cleanup only removed three large toolsets (dotnet, android, ghc), which should free ~14GB. This enhancement adds removal of several additional large packages and caches, bringing the total freed space to approximately 20-25GB. The specific additions include removing Swift and Julia language runtimes, the hosted toolcache directory, all Docker images, numerous large apt packages (aspnetcore, llvm, php, mongodb, mysql, azure-cli, browsers, and development tools), and various cache directories. We also add disk space reporting before and after cleanup to provide visibility into how much space is actually being freed during workflow runs. This enhancement was motivated by release builds running out of disk space when building for all 15 supported platforms (darwin, freebsd, linux, netbsd, openbsd, windows across multiple architectures). The sequential builds with verbose output were consuming more space than the basic cleanup could provide.
39 lines
1.3 KiB
YAML
39 lines
1.3 KiB
YAML
name: "Clean up runner disk space"
|
|
description: "Removes large, non-essential toolsets to free up disk space on the runner."
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Free up disk space
|
|
shell: bash
|
|
run: |
|
|
echo "Removing large toolsets to free up disk space..."
|
|
echo "Disk space before cleanup:"
|
|
df -h
|
|
|
|
# Remove dotnet to save disk space.
|
|
sudo rm -rf /usr/share/dotnet
|
|
# Remove android to save disk space.
|
|
sudo rm -rf /usr/local/lib/android
|
|
# Remove ghc to save disk space.
|
|
sudo rm -rf /opt/ghc
|
|
# Remove large packages.
|
|
sudo rm -rf /usr/share/swift
|
|
sudo rm -rf /usr/local/julia*
|
|
sudo rm -rf /opt/hostedtoolcache
|
|
|
|
# Remove docker images to save space.
|
|
docker image prune -a -f || true
|
|
|
|
# Remove large apt packages.
|
|
sudo apt-get remove -y '^aspnetcore-.*' '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri 2>/dev/null || true
|
|
sudo apt-get autoremove -y
|
|
sudo apt-get clean
|
|
|
|
# Remove caches.
|
|
sudo rm -rf /usr/local/share/boost
|
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
|
|
echo "Disk space after cleanup:"
|
|
df -h
|