Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free Disk Space in Github CIs #206

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Clean Out
run: |
.github/workflows/dependencies/ubuntu_free_disk_space.sh

- name: Install Packages (C++)
if: ${{ matrix.language == 'cpp' }}
run: |
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/dependencies/ubuntu_free_disk_space.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
#
# Copyright 2023 The AMReX Community
#
# License: BSD-3-Clause-LBNL

# Don't want to use the following line because apt-get remove may fail if
# the package specfied does not exist.
# set -eu -o pipefail

# Large packages
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100

echo 'Removing some packages we do not need'

df -h

apt list --installed

sudo apt-get remove -y '^apache.*'
sudo apt-get remove -y '^aspnetcore.*'
sudo apt-get remove -y '^azure.*'
sudo apt-get remove -y '^dotnet.*'
sudo apt-get remove -y '^firebird.*'
sudo apt-get remove -y '^firefox.*'
sudo apt-get remove -y '^google.*'
sudo apt-get remove -y '^hhvm.*'
sudo apt-get remove -y '^microsoft.*'
sudo apt-get remove -y '^mongodb.*'
sudo apt-get remove -y '^mono-.*'
sudo apt-get remove -y '^monodoc-.*'
sudo apt-get remove -y '^mysql.*'
sudo apt-get remove -y '^php.*'
sudo apt-get remove -y '^powershell.*'
sudo apt-get remove -y '^snapd.*'
sudo apt-get remove -y '^temurin.*'

sudo apt-get autoremove -y

df -h