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
50 changes: 50 additions & 0 deletions .github/actions/cleanup-space/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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 android to save disk space.
sudo rm -rf /usr/local/lib/android
# 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
29 changes: 16 additions & 13 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

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

- name: Setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
Expand Down Expand Up @@ -280,11 +283,11 @@ jobs:
name: run itests
runs-on: ubuntu-latest
steps:
- name: cleanup space
run: rm -rf /opt/hostedtoolcache

- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

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

- name: Setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
Expand Down Expand Up @@ -323,11 +326,11 @@ jobs:
name: run itests postgres
runs-on: ubuntu-latest
steps:
- name: cleanup space
run: rm -rf /opt/hostedtoolcache

- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

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

- name: Setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
Expand Down Expand Up @@ -367,11 +370,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: cleanup space
run: rm -rf /opt/hostedtoolcache

- name: git checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

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

- name: Setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
Expand Down
4 changes: 4 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ required Go version ($goversion)."
env CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" GOARM=$arm GOAMD64="v1" go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/tapcli
popd

# Clear Go build cache to prevent disk space issues during multi-platform
# builds.
go clean -cache

# Add the hashes for the individual binaries as well for easy verification
# of a single installed binary.
shasum -a 256 "${dir}/"* >> "manifest-$tag.txt"
Expand Down
Loading