Skip to content

Commit

Permalink
Merge pull request #5262 from novuhq/runner-space
Browse files Browse the repository at this point in the history
Create a script to increase the amount of storage space on default runner
  • Loading branch information
Cliftonz authored Mar 6, 2024
2 parents 254bae6 + a346546 commit 75159d4
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 1 deletion.
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

0 comments on commit 75159d4

Please sign in to comment.