cvw/.github/workflows/test.yml

109 lines
4.1 KiB
YAML
Raw Normal View History

2024-07-16 14:13:40 +00:00
name: List Storage Space
on: [workflow_dispatch]
jobs:
2024-07-17 05:43:42 +00:00
clean-ubuntu:
name: clean ${{ matrix.os }}
2024-07-16 14:22:01 +00:00
runs-on: ${{ matrix.os }}
strategy:
2024-07-17 05:43:42 +00:00
fail-fast: false
2024-07-16 14:22:01 +00:00
matrix:
os: ["ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04"]
2024-07-16 14:13:40 +00:00
steps:
2024-07-17 05:43:42 +00:00
- 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
2024-07-16 14:22:01 +00:00
- name: check packages
run: dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -nr
2024-07-17 05:43:42 +00:00
- 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
2024-07-16 14:22:01 +00:00
2024-07-17 05:43:42 +00:00
clean-rhel:
name: clean ${{ matrix.os }}
runs-on: ubuntu-latest
2024-07-17 07:35:13 +00:00
defaults:
run:
shell: bash
2024-07-17 05:43:42 +00:00
container:
image: ${{ matrix.os }}
2024-07-17 07:35:13 +00:00
options: --privileged --mount type=bind,source=/,target=/host --pid=host --entrypoint /bin/bash
2024-07-17 05:43:42 +00:00
strategy:
fail-fast: false
matrix:
os: ["rockylinux:8", "almalinux:8", "rockylinux:9", "almalinux:9"]
steps:
2024-07-17 07:20:46 +00:00
- run: dnf install -y sudo git
2024-07-17 06:51:29 +00:00
- uses: actions/checkout@v4
2024-07-17 05:43:42 +00:00
- run: df -h
- name: remove packages
2024-07-17 07:35:13 +00:00
run: |
2024-07-17 08:42:02 +00:00
nsenter -t 1 -m -u -n -i bash -c "$(cat .github/cli-space-cleanup.sh)"
2024-07-17 05:43:42 +00:00
- 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