Skip to content

Commit

Permalink
🐛 fixup actions
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Runde <[email protected]>
  • Loading branch information
joerunde committed Oct 2, 2024
1 parent d8dc0c3 commit 21d359d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/actions/free-up-disk-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Free up disk space"
description: "Removes non-essential tools, libraries and cached files from GitHub action runner node"

runs:
using: "composite"
steps:
- name: "Remove non-essential tools and libraries"
shell: bash
run: |
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
echo "Disk usage before cleanup:"
df -h
echo "Removing non-essential tools and libraries ..."
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/share/dotnet
# sudo rm -rf /usr/local/share/boost
echo "Deleting libraries for Android (12G), CodeQL (5.3G), PowerShell (1.3G), Swift (1.7G) ..."
sudo rm -rf /usr/local/lib/android
sudo rm -rf "${AGENT_TOOLSDIRECTORY}/CodeQL"
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/share/swift
# ref: https://github.com/jlumbroso/free-disk-space/blob/main/action.yml
echo "Deleting some larger apt packages:"
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing || echo "::warning::The command [sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing] failed to complete successfully. Proceeding..."
echo "Disk usage after cleanup:"
df -h
- name: "Prune docker images"
shell: bash
run: |
echo "Pruning docker images ..."
docker image prune -a -f
docker system df
echo "Disk usage after pruning docker images:"
df -h

0 comments on commit 21d359d

Please sign in to comment.