cvw/.github/workflows/test.yml
2024-10-15 20:42:21 -07:00

111 lines
4.2 KiB
YAML

name: List Storage Space
on: [workflow_dispatch]
jobs:
clean-ubuntu:
name: clean ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04"]
steps:
- run: df -h
- name: remove packages
run: |
removePacks=( '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' '^dotnet-sdk-.*' 'azure-cli' 'google-cloud-cli' 'google-chrome-stable' 'firefox' 'powershell*' 'microsoft-edge-stable' 'mono-devel' )
for pack in "${removePacks[@]}"; do
echo "REMOVING ${pack}"
sudo apt-get purge -y $pack || true
done
sudo apt-get autoremove -y
sudo apt-get clean
- run: df -h
- name: check packages
run: dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -nr
- name: remove dirs
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/share/swift
sudo rm -rf /usr/share/miniconda
sudo rm -rf /usr/share/az*
sudo rm -rf /usr/share/gradle-*
sudo rm -rf /usr/share/sbt
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf /usr/local/julia*
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/share/vcpkg
sudo rm -rf /usr/local/games
sudo rm -rf /usr/local/sqlpackage
sudo rm -rf /usr/lib/google-cloud-sdk
sudo rm -rf /usr/lib/jvm
sudo rm -rf /usr/lib/mono
sudo rm -rf /usr/lib/R
sudo rm -rf /usr/lib/postgresql
sudo rm -rf /usr/lib/heroku
sudo rm -rf /usr/lib/llvm*
sudo rm -rf /usr/lib/firefox
sudo rm -rf /opt/hostedtoolcache
sudo docker image prune --all --force
- run: df -h
clean-rhel:
name: clean ${{ matrix.os }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: ${{ matrix.os }}
options: --privileged --mount type=bind,source=/,target=/host --pid=host --entrypoint /bin/bash
strategy:
fail-fast: false
matrix:
os: ["rockylinux:8", "almalinux:8", "rockylinux:9", "almalinux:9"]
steps:
- run: dnf install -y sudo git
- uses: actions/checkout@v4
- run: df -h
- name: remove packages
run: |
cd .github
ls
nsenter -t 1 -m -u -n -i bash cli-space-cleanup.sh #-c "sudo apt-get purge -y google-cloud-cli || true; sudo apt-get autoremove -y; sudo apt-get clean"
- run: df -h
- name: check packages
run: dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -nr
- name: remove dirs
run: |
sudo rm -rf host/usr/local/lib/android
sudo rm -rf host/usr/share/dotnet
sudo rm -rf host/usr/share/swift
sudo rm -rf host/usr/share/miniconda
sudo rm -rf host/usr/share/az*
sudo rm -rf host/usr/share/gradle-*
sudo rm -rf host/usr/share/sbt
sudo rm -rf host/opt/ghc
sudo rm -rf host/usr/local/.ghcup
sudo rm -rf host/usr/local/share/powershell
sudo rm -rf host/usr/local/lib/node_modules
sudo rm -rf host/usr/local/julia*
sudo rm -rf host/usr/local/share/chromium
sudo rm -rf host/usr/local/share/vcpkg
sudo rm -rf host/usr/local/games
sudo rm -rf host/usr/local/sqlpackage
sudo rm -rf host/usr/lib/google-cloud-sdk
sudo rm -rf host/usr/lib/jvm
sudo rm -rf host/usr/lib/mono
sudo rm -rf host/usr/lib/R
sudo rm -rf host/usr/lib/postgresql
sudo rm -rf host/usr/lib/heroku
sudo rm -rf host/usr/lib/llvm*
sudo rm -rf host/usr/lib/firefox
sudo rm -rf host/opt/hostedtoolcache
sudo docker image prune --all --force
- run: df -h