This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new a488b29425 GH-37129: [CI][Docs] Free up disk space (#37131)
a488b29425 is described below

commit a488b29425c8913e979e71d6814c414e737c7835
Author: Sutou Kouhei <[email protected]>
AuthorDate: Sat Aug 12 12:26:07 2023 +0900

    GH-37129: [CI][Docs] Free up disk space (#37131)
    
    ### Rationale for this change
    
    We need many disk space for building docs.
    
    ### What changes are included in this PR?
    
    Reuse existing free code.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    No.
    * Closes: #37129
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 .github/workflows/docs.yml    |  3 ++
 ci/scripts/util_free_space.sh | 71 +++++++++++++++++++++++++++++++++++++++++++
 dev/tasks/macros.jinja        | 48 +----------------------------
 3 files changed, 75 insertions(+), 47 deletions(-)

diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 8bef50335a..ac9ca6da25 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -41,6 +41,9 @@ jobs:
         uses: actions/checkout@v3
         with:
           fetch-depth: 0
+      - name: Free up disk space
+        run: |
+          ci/scripts/util_free_space.sh
       - name: Cache Docker Volumes
         uses: actions/cache@v3
         with:
diff --git a/ci/scripts/util_free_space.sh b/ci/scripts/util_free_space.sh
new file mode 100755
index 0000000000..54445d0d49
--- /dev/null
+++ b/ci/scripts/util_free_space.sh
@@ -0,0 +1,71 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -eux
+
+if [ "${GITHUB_ACTIONS}" = "true" ]; then
+  df -h
+  echo "::group::/usr/local/*"
+  du -hsc /usr/local/*
+  echo "::endgroup::"
+  echo "::group::/usr/local/bin/*"
+  du -hsc /usr/local/bin/*
+  echo "::endgroup::"
+  # ~1GB (From 1.2GB to 214MB)
+  sudo rm -rf \
+    /usr/local/bin/aliyun \
+    /usr/local/bin/azcopy \
+    /usr/local/bin/bicep \
+    /usr/local/bin/cmake-gui \
+    /usr/local/bin/cpack \
+    /usr/local/bin/helm \
+    /usr/local/bin/hub \
+    /usr/local/bin/kubectl \
+    /usr/local/bin/minikube \
+    /usr/local/bin/node \
+    /usr/local/bin/packer \
+    /usr/local/bin/pulumi* \
+    /usr/local/bin/stack \
+    /usr/local/bin/terraform || :
+  echo "::group::/usr/local/share/*"
+  du -hsc /usr/local/share/*
+  echo "::endgroup::"
+  # 1.3GB
+  sudo rm -rf /usr/local/share/powershell || :
+  echo "::group::/opt/*"
+  du -hsc /opt/*
+  echo "::endgroup::"
+  echo "::group::/opt/hostedtoolcache/*"
+  du -hsc /opt/hostedtoolcache/*
+  echo "::endgroup::"
+  # 5.3GB
+  sudo rm -rf /opt/hostedtoolcache/CodeQL || :
+  # 1.4GB
+  sudo rm -rf /opt/hostedtoolcache/go || :
+  # 489MB
+  sudo rm -rf /opt/hostedtoolcache/PyPy || :
+  # 376MB
+  sudo rm -rf /opt/hostedtoolcache/node || :
+  # Remove Web browser packages
+  sudo apt purge -y \
+    firefox \
+    google-chrome-stable \
+    microsoft-edge-stable
+  df -h
+fi
diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja
index 757c15c937..8ec351a270 100644
--- a/dev/tasks/macros.jinja
+++ b/dev/tasks/macros.jinja
@@ -77,53 +77,7 @@ on:
     if: runner.os == 'Linux' && runner.arch == 'X64'
     shell: bash
     run: |
-      df -h
-      echo "::group::/usr/local/*"
-      du -hsc /usr/local/*
-      echo "::endgroup::"
-      echo "::group::/usr/local/bin/*"
-      du -hsc /usr/local/bin/*
-      echo "::endgroup::"
-      # ~1GB (From 1.2GB to 214MB)
-      sudo rm -rf \
-        /usr/local/bin/aliyun \
-        /usr/local/bin/azcopy \
-        /usr/local/bin/bicep \
-        /usr/local/bin/cmake-gui \
-        /usr/local/bin/cpack \
-        /usr/local/bin/helm \
-        /usr/local/bin/hub \
-        /usr/local/bin/kubectl \
-        /usr/local/bin/minikube \
-        /usr/local/bin/node \
-        /usr/local/bin/packer \
-        /usr/local/bin/pulumi* \
-        /usr/local/bin/stack \
-        /usr/local/bin/terraform || :
-      echo "::group::/usr/local/share/*"
-      du -hsc /usr/local/share/*
-      echo "::endgroup::"
-      # 1.3GB
-      sudo rm -rf /usr/local/share/powershell || :
-      echo "::group::/opt/*"
-      du -hsc /opt/*
-      echo "::endgroup::"
-      echo "::group::/opt/hostedtoolcache/*"
-      du -hsc /opt/hostedtoolcache/*
-      echo "::endgroup::"
-      # 5.3GB
-      sudo rm -rf /opt/hostedtoolcache/CodeQL || :
-      # 1.4GB
-      sudo rm -rf /opt/hostedtoolcache/go || :
-      # 489MB
-      sudo rm -rf /opt/hostedtoolcache/PyPy || :
-      # 376MB
-      sudo rm -rf /opt/hostedtoolcache/node || :
-      # Remove Web browser packages
-      sudo apt-get purge -y -f firefox \
-              google-chrome-stable \
-              microsoft-edge-stable
-      df -h
+      arrow/ci/scripts/util_free_space.sh
 {% endmacro %}
 
 {%- macro github_upload_releases(pattern) -%}

Reply via email to