Skip to content
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
12 changes: 12 additions & 0 deletions .github/actions/cleanup-android/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Clean up android sdk/ndk"
description: "Removes Android SDK/NDK to free up disk space on the runner."

runs:
using: "composite"
steps:
- name: Remove android toolchain
shell: bash
run: |
echo "Removing android toolchain to free up disk space..."
sudo rm -rf /usr/local/lib/android
df -h
48 changes: 48 additions & 0 deletions .github/actions/cleanup-space/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Clean up runner disk space"
description: "Removes large, non-essential toolsets to free up disk space on the runner."

runs:
using: "composite"
steps:
- name: Free up disk space
shell: bash
run: |
echo "Removing large toolsets to free up disk space..."
echo "Disk space before cleanup:"
df -h

# Remove dotnet to save disk space.
sudo rm -rf /usr/share/dotnet
# Remove ghc to save disk space.
sudo rm -rf /opt/ghc
# Remove large packages.
sudo rm -rf /usr/share/swift
sudo rm -rf /usr/local/julia*
sudo rm -rf /opt/hostedtoolcache

# Remove docker images to save space.
docker image prune -a -f || true

# Remove large apt packages.
sudo apt-get remove -y \
'^aspnetcore-.*' \
'^dotnet-.*' \
'^llvm-.*' \
'php.*' \
'^mongodb-.*' \
'^mysql-.*' \
azure-cli \
google-chrome-stable \
firefox \
powershell \
mono-devel \
libgl1-mesa-dri 2>/dev/null || true
sudo apt-get autoremove -y
sudo apt-get clean

# Remove caches.
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

echo "Disk space after cleanup:"
df -h
32 changes: 28 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Clean up runner space
uses: ./.github/actions/cleanup-space

- name: go cache
uses: actions/cache@v3
Expand Down Expand Up @@ -60,6 +63,9 @@ jobs:
- name: wasm compile
run: make wasm

- name: Clean up runner space (android)
uses: ./.github/actions/cleanup-android

########################
# lint code
########################
Expand All @@ -68,10 +74,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Clean up runner space
uses: ./.github/actions/cleanup-space

- name: Clean up runner space (android)
uses: ./.github/actions/cleanup-android

- name: go cache
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -106,7 +118,13 @@ jobs:
- unit-race
steps:
- name: git checkout
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Clean up runner space
uses: ./.github/actions/cleanup-space

- name: Clean up runner space (android)
uses: ./.github/actions/cleanup-android

- name: go cache
uses: actions/cache@v3
Expand Down Expand Up @@ -135,7 +153,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Clean up runner space
uses: ./.github/actions/cleanup-space

- name: Clean up runner space (android)
uses: ./.github/actions/cleanup-android

- name: go cache
uses: actions/cache@v3
Expand Down