cleanup script

This commit is contained in:
Tyler Mayoff 2025-07-04 21:59:12 -04:00
parent b26a67cb26
commit 0185d1b33a
2 changed files with 18 additions and 20 deletions

View file

@ -5,21 +5,6 @@ inputs:
description: Enabling this will print before and after disk sizes description: Enabling this will print before and after disk sizes
default: false default: false
required: false required: false
paths:
description: List of paths to clear
required: false
default:
- /opt/microsoft
- /usr/share/dotnet
- /usr/share/swift
- /usr/lib/jvm
- /usr/local/.ghcup
- /home/runner/.rustup
- /usr/local/share/chromium
- /usr/local/lib/android
- /opt/ghc
- /opt/hostedtoolcache
- /usr/lib/llvm-18
runs: runs:
using: "composite" using: "composite"
@ -39,11 +24,7 @@ runs:
- name: Clear - name: Clear
shell: bash shell: bash
run: | run: |
SAVEIFS=$IFS ./clean.sh
IFS=$'\n'
paths=${{ inputs.paths }}
IFS=$SAVEIFS
sudo rm -rf $paths
sudo docker system prune -af || true sudo docker system prune -af || true
sudo docker image prune -af || true sudo docker image prune -af || true
sudo docker builder prune -af || true sudo docker builder prune -af || true

17
.github/actions/disk_space/clean.sh vendored Normal file
View file

@ -0,0 +1,17 @@
#!/bin/bash
paths=(
"/home/runner/.rustup"
"/usr/share/dotnet"
"/usr/share/swift"
"/usr/lib/jvm"
"/usr/lib/llvm-18"
"/usr/local/.ghcup"
"/usr/local/share/chromium"
"/usr/local/lib/android"
"/opt/ghc"
"/opt/microsoft"
"/opt/hostedtoolcache"
)
sudo rm -rf "${paths[@]}"