Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a script to increase the amount of storage space on default runner #5262

Merged
merged 4 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,13 @@
"spyon",
"restapi",
"ringcentral",
"reshard"
"reshard",
"endgroup",
"aliyun",
"azcopy",
"cpack",
"pulumi",
"hostedtoolcache"
],
"flagWords": [],
"patterns": [
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/docker/build-api/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ runs:
shell: bash
run: pnpm build:api

# TODO Removed when migrated to action matrix for each build type
- uses: ./.github/actions/free-space

- uses: crazy-max/ghaction-setup-docker@v2
with:
version: v24.0.6
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/docker/build-worker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ runs:
shell: bash
run: pnpm build:worker

# TODO Removed when migrated to action matrix for each build type
- uses: ./.github/actions/free-space

- uses: crazy-max/ghaction-setup-docker@v2
with:
version: v24.0.6
Expand Down
65 changes: 65 additions & 0 deletions .github/actions/free-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env bash

set -eux

df -h
echo "::group::apt clean"
sudo apt clean
echo "::endgroup::"

echo "::group::/usr/local/*"
du -hsc /usr/local/*
echo "::endgroup::"
# ~1GB
sudo rm -rf \
/usr/local/aws-sam-cil \
/usr/local/julia* || :
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/hub \
/usr/local/bin/kubectl \
/usr/local/bin/minikube \
/usr/local/bin/packer \
/usr/local/bin/pulumi* \
/usr/local/bin/sam \
/usr/local/bin/stack || :
# 142M
sudo rm -rf /usr/local/bin/oc || : \
echo "::group::/usr/local/share/*"
du -hsc /usr/local/share/*
echo "::endgroup::"
# 506MB
sudo rm -rf /usr/local/share/chromium || :
# 1.3GB
sudo rm -rf /usr/local/share/powershell || :
echo "::group::/usr/local/lib/*"
du -hsc /usr/local/lib/*
echo "::endgroup::"
# 15GB
sudo rm -rf /usr/local/lib/android || :
# 341MB
sudo rm -rf /usr/local/lib/heroku || :
# 679MB
sudo rm -rf /opt/az || :
echo "::group::/opt/microsoft/*"
du -hsc /opt/microsoft/*
echo "::endgroup::"
# 197MB
sudo rm -rf /opt/microsoft/powershell || :
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 || :

df -h
Loading