Skip to content

Commit fdfcf82

Browse files
authored
Merge pull request #253 from influxdata/crepererum/more-disk-space
ci: free up more disk space
2 parents a9cde19 + 9cc3879 commit fdfcf82

File tree

1 file changed

+25
-5
lines changed
  • .github/actions/free-disk-space

1 file changed

+25
-5
lines changed

.github/actions/free-disk-space/free.sh

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ set -euo pipefail
55
df -h
66

77
to_delete=(
8-
"/lib/firefox"
9-
"/lib/google-cloud-sdk"
10-
"/lib/jvm"
11-
"/lib/llvm-16"
12-
"/lib/llvm-17"
138
"/opt/az"
149
"/opt/google"
1510
"/opt/hostedtoolcache/CodeQL"
@@ -19,10 +14,35 @@ to_delete=(
1914
"/opt/hostedtoolcache/node"
2015
"/opt/microsoft"
2116
"/opt/pipx"
17+
"/usr/lib/firefox"
18+
"/usr/lib/google-cloud-sdk"
19+
"/usr/lib/jvm"
20+
"/usr/lib/llvm-16"
21+
"/usr/lib/llvm-17"
22+
"/usr/local/.ghcup"
23+
"/usr/local/lib/android"
2224
"/usr/share/swift"
2325
)
26+
2427
for d in "${to_delete[@]}"; do
2528
echo "delete $d"
29+
30+
if [ ! -d "$d" ]; then
31+
echo "directory does NOT exist"
32+
exit 1
33+
fi
34+
35+
if [ -L "$d" ]; then
36+
echo "directory is a symlink, but we should delete the original source"
37+
exit 1
38+
fi
39+
40+
r="$(realpath "$d")"
41+
if [ "$d" != "$r" ]; then
42+
echo "not a canonical path, use this instead: $r"
43+
exit 1
44+
fi
45+
2646
sudo rm -rf "$d"
2747
done
2848

0 commit comments

Comments
 (0)