Skip to content

Commit b57b49e

Browse files
authored
fix(ci): Free Disk Space (#4529)
改用新的方法,清理其他不必要的目录以获取更多可用空间
1 parent cdead46 commit b57b49e

File tree

3 files changed

+50
-4
lines changed

3 files changed

+50
-4
lines changed

.github/workflows/ci-main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ jobs:
221221
detached: true
222222
limit-access-to-actor: false
223223

224+
- name: Free Disk Space
225+
run: |
226+
df -h /
227+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/hostedtoolcache/CodeQL /opt/hostedtoolcache/Python || true
228+
df -h /
229+
224230
- name: Start Apollo Containers
225231
run: docker compose -f ".github/workflows/apollo/docker-compose.yml" up -d --build
226232

.github/workflows/scripts/ci-main-clean.sh

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,44 @@ fi
207207
# da96a7ad7a01 mariadb:11.4 "docker-entrypoint.s…" 7 minutes ago Up 7 minutes 0.0.0.0:3307->3306/tcp, [::]:3307->3306/tcp 45eed646fa6c4a698893ee11cda95a4c_mariadb114_3a9cd6 2B (virtual 332MB)
208208
# 27ba1904ba3a mysql:5.7 "docker-entrypoint.s…" 7 minutes ago Up 7 minutes 0.0.0.0:3306->3306/tcp, [::]:3306->3306/tcp, 33060/tcp ea6d7a4c207d427a95b5ae0db91fdf56_mysql57_c21053 4B (virtual 501MB)
209209
# 518e785d1bb6 redis:7.0 "docker-entrypoint.s…" 7 minutes ago Up 7 minutes (healthy) 0.0.0.0:6379->6379/tcp, [::]:6379->6379/tcp af6044fc849e441bbc6c48f7a5ec5fec_redis70_b11994 0B (virtual 109MB)
210-
# 7495ec2cd8e3 bitnamilegacy/etcd:3.4.24 "/opt/bitnami/script…" 7 minutes ago Up 7 minutes 0.0.0.0:2379->2379/tcp, [::]:2379->2379/tcp, 2380/tcp 49f2a2a6bf3a4fae842cc950bbc3658a_bitnamilegacyetcd3424_1265e1 145MB (virtual 279MB)
210+
# 7495ec2cd8e3 bitnamilegacy/etcd:3.4.24 "/opt/bitnami/script…" 7 minutes ago Up 7 minutes 0.0.0.0:2379->2379/tcp, [::]:2379->2379/tcp, 2380/tcp 49f2a2a6bf3a4fae842cc950bbc3658a_bitnamilegacyetcd3424_1265e1 145MB (virtual 279MB)
211+
212+
# runner@runnervmg1sw1:~/work/gf/gf$ du -ah --max-depth=1 /usr | sort -n
213+
# 4.0K /usr/games
214+
# 4.0K /usr/lib64
215+
# 6.6G /usr/lib
216+
# 9.3G /usr/share
217+
# 15M /usr/lib32
218+
# 24G /usr/local
219+
# 41G /usr
220+
# 95M /usr/sbin
221+
# 156M /usr/include
222+
# 158M /usr/src
223+
# 402M /usr/libexec
224+
# 841M /usr/bin
225+
226+
# runner@runnervmg1sw1:~/work/gf/gf$ du -ah --max-depth=1 /opt | sort -n
227+
# 4.0K /opt/pipx_bin
228+
# 5.8G /opt/hostedtoolcache
229+
# 8.5G /opt
230+
# 12K /opt/containerd
231+
# 14M /opt/hca
232+
# 16K /opt/post-generation
233+
# 217M /opt/runner-cache
234+
# 243M /opt/actionarchivecache
235+
# 374M /opt/google
236+
# 515M /opt/pipx
237+
# 655M /opt/az
238+
# 783M /opt/microsoft
239+
240+
# runner@runnervmg1sw1:~/work/gf/gf$ du -ah --max-depth=1 /opt/hostedtoolcache/ | sort -n
241+
# 1.1G /opt/hostedtoolcache/go
242+
# 1.6G /opt/hostedtoolcache/CodeQL
243+
# 1.9G /opt/hostedtoolcache/Python
244+
# 5.8G /opt/hostedtoolcache/
245+
# 9.9M /opt/hostedtoolcache/protoc
246+
# 24K /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk
247+
# 217M /opt/hostedtoolcache/Ruby
248+
# 520M /opt/hostedtoolcache/PyPy
249+
# 574M /opt/hostedtoolcache/node
250+

.github/workflows/scripts/ci-main.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ for file in `find . -name go.mod`; do
1111
# TODO remove this ignoring codes after the mssql docker service OK
1212
if [ "mssql" = $(basename $dirpath) ]; then
1313
# clean docker containers and images to free disk space
14-
bash .github/workflows/scripts/ci-main-clean.sh "$dirpath"
14+
# bash .github/workflows/scripts/ci-main-clean.sh "$dirpath"
1515
continue 1
1616
fi
1717

@@ -36,7 +36,7 @@ for file in `find . -name go.mod`; do
3636
if ! go version | grep -qE "go${LATEST_GO_VERSION}"; then
3737
echo "ignore path $dirpath as go version is not ${LATEST_GO_VERSION}: $(go version)"
3838
# clean docker containers and images to free disk space
39-
bash .github/workflows/scripts/ci-main-clean.sh "$dirpath"
39+
# bash .github/workflows/scripts/ci-main-clean.sh "$dirpath"
4040
continue 1
4141
fi
4242
fi
@@ -63,5 +63,5 @@ for file in `find . -name go.mod`; do
6363

6464
cd -
6565
# clean docker containers and images to free disk space
66-
bash .github/workflows/scripts/ci-main-clean.sh "$dirpath"
66+
# bash .github/workflows/scripts/ci-main-clean.sh "$dirpath"
6767
done

0 commit comments

Comments
 (0)