Skip to content

Commit

Permalink
apacheGH-36947: [CI] Move free up disk space to its own action and us…
Browse files Browse the repository at this point in the history
…e it on docs job
  • Loading branch information
raulcd committed Jul 31, 2023
1 parent a06b261 commit aa823b2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 49 deletions.
1 change: 1 addition & 0 deletions dev/tasks/docs/github.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
{{ macros.github_set_env(env) }}
steps:
{{ macros.github_checkout_arrow(fetch_depth=fetch_depth|default(1))|indent }}
{{ macros.github_free_space()|indent }}
{{ macros.github_install_archery()|indent }}

- name: Execute Docker Build
Expand Down
50 changes: 1 addition & 49 deletions dev/tasks/linux-packages/github.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,56 +32,8 @@ jobs:
steps:
{{ macros.github_checkout_arrow()|indent }}
{{ macros.github_login_dockerhub()|indent }}
{{ macros.github_free_space()|indent }}

- name: Free up disk space
if: |
env.ARCHITECTURE == 'amd64'
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 || :
# 1.2GB
sudo rm -rf /opt/hostedtoolcache/Python || :
# 376MB
sudo rm -rf /opt/hostedtoolcache/node || :
df -h
- name: Set up Ruby
run: |
sudo apt update
Expand Down
52 changes: 52 additions & 0 deletions dev/tasks/macros.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,58 @@ on:
run: pip install -e arrow/dev/archery[all]
{% endmacro %}

{%- macro github_free_space() -%}
- name: Free up disk space
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 || :
# 1.2GB
sudo rm -rf /opt/hostedtoolcache/Python || :
# 376MB
sudo rm -rf /opt/hostedtoolcache/node || :
df -h
{% endmacro %}

{%- macro github_upload_releases(pattern) -%}
- name: Set up Python by actions/setup-python
if: runner.arch == 'X64'
Expand Down

0 comments on commit aa823b2

Please sign in to comment.