Skip to content

Commit

Permalink
add disk space cleanup script (#45322)
Browse files Browse the repository at this point in the history
  • Loading branch information
gopidesupavan authored Jan 1, 2025
1 parent 0c92638 commit 59bc37f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/finalize-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ jobs:
- name: "Cleanup repo"
shell: bash
run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
- name: Free up disk space
shell: bash
run: ./scripts/tools/free_up_disk_space.sh
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
Expand Down
39 changes: 39 additions & 0 deletions scripts/tools/free_up_disk_space.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/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.

COLOR_BLUE=$'\e[34m'
COLOR_RESET=$'\e[0m'

echo "${COLOR_BLUE}Disk space before cleanup${COLOR_RESET}"
df -h

echo "${COLOR_BLUE}Freeing up disk space${COLOR_RESET}"
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/graalvm/
sudo rm -rf /usr/local/.ghcup/
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/share/boost
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /opt/hostedtoolcache/Ruby
sudo rm -rf /opt/hostedtoolcache/go
sudo rm -rf /opt/ghc
sudo apt-get clean
echo "${COLOR_BLUE}Disk space after cleanup${COLOR_RESET}"
df -h

0 comments on commit 59bc37f

Please sign in to comment.