Skip to content

Commit e1d5aef

Browse files
committed
CI: support free disk space for workflows in Ubuntu
Similar to the free disk space actions for workflows in Rocky Linux, this commit adds the same feature to the workflows in Ubuntu. You can see #1511 for details.
1 parent 85e70a0 commit e1d5aef

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.github/workflows/build-deb-cloudberry.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,33 @@ jobs:
355355
options: >-
356356
--user root
357357
-h cdw
358+
-v /usr/share:/host_usr_share
359+
-v /usr/local:/host_usr_local
360+
-v /opt:/host_opt
358361
359362
steps:
363+
- name: Free Disk Space
364+
if: needs.check-skip.outputs.should_skip != 'true'
365+
run: |
366+
echo "=== Disk space before cleanup ==="
367+
df -h /
368+
369+
# Remove pre-installed tools from host to free disk space
370+
rm -rf /host_opt/hostedtoolcache || true # GitHub Actions tool cache
371+
rm -rf /host_usr_local/lib/android || true # Android SDK
372+
rm -rf /host_usr_share/dotnet || true # .NET SDK
373+
rm -rf /host_opt/ghc || true # Haskell GHC
374+
rm -rf /host_usr_local/.ghcup || true # Haskell GHCup
375+
rm -rf /host_usr_share/swift || true # Swift
376+
rm -rf /host_usr_local/share/powershell || true # PowerShell
377+
rm -rf /host_usr_local/share/chromium || true # Chromium
378+
rm -rf /host_usr_share/miniconda || true # Miniconda
379+
rm -rf /host_opt/az || true # Azure CLI
380+
rm -rf /host_usr_share/sbt || true # Scala Build Tool
381+
382+
echo "=== Disk space after cleanup ==="
383+
df -h /
384+
360385
- name: Skip Check
361386
if: needs.check-skip.outputs.should_skip == 'true'
362387
run: |
@@ -646,8 +671,33 @@ jobs:
646671
options: >-
647672
--user root
648673
-h cdw
674+
-v /usr/share:/host_usr_share
675+
-v /usr/local:/host_usr_local
676+
-v /opt:/host_opt
649677
650678
steps:
679+
- name: Free Disk Space
680+
if: needs.check-skip.outputs.should_skip != 'true'
681+
run: |
682+
echo "=== Disk space before cleanup ==="
683+
df -h /
684+
685+
# Remove pre-installed tools from host to free disk space
686+
rm -rf /host_opt/hostedtoolcache || true # GitHub Actions tool cache
687+
rm -rf /host_usr_local/lib/android || true # Android SDK
688+
rm -rf /host_usr_share/dotnet || true # .NET SDK
689+
rm -rf /host_opt/ghc || true # Haskell GHC
690+
rm -rf /host_usr_local/.ghcup || true # Haskell GHCup
691+
rm -rf /host_usr_share/swift || true # Swift
692+
rm -rf /host_usr_local/share/powershell || true # PowerShell
693+
rm -rf /host_usr_local/share/chromium || true # Chromium
694+
rm -rf /host_usr_share/miniconda || true # Miniconda
695+
rm -rf /host_opt/az || true # Azure CLI
696+
rm -rf /host_usr_share/sbt || true # Scala Build Tool
697+
698+
echo "=== Disk space after cleanup ==="
699+
df -h /
700+
651701
- name: Skip Check
652702
if: needs.check-skip.outputs.should_skip == 'true'
653703
run: |
@@ -834,8 +884,33 @@ jobs:
834884
--ulimit core=-1
835885
--cgroupns=host
836886
-v /sys/fs/cgroup:/sys/fs/cgroup:rw
887+
-v /usr/share:/host_usr_share
888+
-v /usr/local:/host_usr_local
889+
-v /opt:/host_opt
837890
838891
steps:
892+
- name: Free Disk Space
893+
if: needs.check-skip.outputs.should_skip != 'true'
894+
run: |
895+
echo "=== Disk space before cleanup ==="
896+
df -h /
897+
898+
# Remove pre-installed tools from host to free disk space
899+
rm -rf /host_opt/hostedtoolcache || true # GitHub Actions tool cache
900+
rm -rf /host_usr_local/lib/android || true # Android SDK
901+
rm -rf /host_usr_share/dotnet || true # .NET SDK
902+
rm -rf /host_opt/ghc || true # Haskell GHC
903+
rm -rf /host_usr_local/.ghcup || true # Haskell GHCup
904+
rm -rf /host_usr_share/swift || true # Swift
905+
rm -rf /host_usr_local/share/powershell || true # PowerShell
906+
rm -rf /host_usr_local/share/chromium || true # Chromium
907+
rm -rf /host_usr_share/miniconda || true # Miniconda
908+
rm -rf /host_opt/az || true # Azure CLI
909+
rm -rf /host_usr_share/sbt || true # Scala Build Tool
910+
911+
echo "=== Disk space after cleanup ==="
912+
df -h /
913+
839914
- name: Skip Check
840915
if: needs.check-skip.outputs.should_skip == 'true'
841916
run: |

0 commit comments

Comments
 (0)