Skip to content

Commit 21ccdf9

Browse files
ax3lWeiqunZhang
andauthored
Free Disk Space in Github CIs (#206)
Add a new script that removes some packages we do not need. It can free up about 7 GB of space on Ubuntu. See: AMReX-Codes/amrex#3574 Co-authored-by: Weiqun Zhang <weiqunzhang@lbl.gov>
1 parent 6779a70 commit 21ccdf9

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ jobs:
3030
- name: Checkout
3131
uses: actions/checkout@v3
3232

33+
- name: Clean Out
34+
run: |
35+
.github/workflows/dependencies/ubuntu_free_disk_space.sh
36+
3337
- name: Install Packages (C++)
3438
if: ${{ matrix.language == 'cpp' }}
3539
run: |
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2023 The AMReX Community
4+
#
5+
# License: BSD-3-Clause-LBNL
6+
7+
# Don't want to use the following line because apt-get remove may fail if
8+
# the package specfied does not exist.
9+
# set -eu -o pipefail
10+
11+
# Large packages
12+
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100
13+
14+
echo 'Removing some packages we do not need'
15+
16+
df -h
17+
18+
apt list --installed
19+
20+
sudo apt-get remove -y '^apache.*'
21+
sudo apt-get remove -y '^aspnetcore.*'
22+
sudo apt-get remove -y '^azure.*'
23+
sudo apt-get remove -y '^dotnet.*'
24+
sudo apt-get remove -y '^firebird.*'
25+
sudo apt-get remove -y '^firefox.*'
26+
sudo apt-get remove -y '^google.*'
27+
sudo apt-get remove -y '^hhvm.*'
28+
sudo apt-get remove -y '^microsoft.*'
29+
sudo apt-get remove -y '^mongodb.*'
30+
sudo apt-get remove -y '^mono-.*'
31+
sudo apt-get remove -y '^monodoc-.*'
32+
sudo apt-get remove -y '^mysql.*'
33+
sudo apt-get remove -y '^php.*'
34+
sudo apt-get remove -y '^powershell.*'
35+
sudo apt-get remove -y '^snapd.*'
36+
sudo apt-get remove -y '^temurin.*'
37+
38+
sudo apt-get autoremove -y
39+
40+
df -h

0 commit comments

Comments
 (0)