Skip to content

Commit

Permalink
Add action to free up space in GH runner
Browse files Browse the repository at this point in the history
  • Loading branch information
valldrac committed Aug 19, 2024
1 parent c9795c7 commit 1271574
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/actions/disk-cleanup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Disk cleanup
description: "Free up disk space by removing unused pre-installed software."
runs:
using: composite
steps:
- name: Free up disk space
shell: bash
run: |
echo "Disk space before cleanup:"
df -h /
echo "Removing unused software..."
sudo rm -rf \
/opt/google/chrome \
/opt/microsoft/msedge \
/opt/microsoft/powershell \
/usr/lib/mono \
/usr/local/.ghcup \
/usr/local/share/chromium \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift \
echo "Disk space after cleanup:"
df -h /
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
runs-on: ubuntu-22.04

steps:
- name: Free up disk space
run: sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/powershell /usr/local/share/chromium

- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

Expand All @@ -38,6 +35,9 @@ jobs:
git config --global user.name "build"
git config --global user.email "localhost"
- name: Free up disk space in runner
uses: ./.github/actions/disk-cleanup

- name: Install Rust targets
run: rustup toolchain install $(cat rust-toolchain) --profile minimal --target aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android

Expand Down

0 comments on commit 1271574

Please sign in to comment.