Skip to content

Commit

Permalink
ci: Create composite action for maximizing the build space
Browse files Browse the repository at this point in the history
Signed-off-by: Lars Kreutzer <lars.kreutzer@tngtech.com>
  • Loading branch information
LKreutzer committed Jul 19, 2022
1 parent 660551a commit 8594fd9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 55 deletions.
24 changes: 2 additions & 22 deletions .github/workflows/agw-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,7 @@ jobs:
name: C/C++ unit tests with Bazel
runs-on: ubuntu-latest
steps:
- name: Maximize build space
shell: bash
run: |
echo "Available storage before:"
df -h
echo "Removing /usr/share/dotnet, /usr/local/lib/android, /opt/ghc"
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo "Available storage after:"
df -h
- uses: ./.github/workflows/composite/maximize-build-space
- name: Check Out Repo
# This is necessary for overlays into the Docker container below.
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
Expand Down Expand Up @@ -339,17 +329,7 @@ jobs:
BRANCH: "${{ github.base_ref }}"
REVISION: "${{ github.sha }}"
steps:
- name: Maximize build space
shell: bash
run: |
echo "Available storage before:"
df -h
echo "Removing /usr/share/dotnet, /usr/local/lib/android, /opt/ghc"
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo "Available storage after:"
df -h
- uses: ./.github/workflows/composite/maximize-build-space
- name: Check Out Repo
# This is necessary for overlays into the Docker container below.
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
Expand Down
24 changes: 2 additions & 22 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,7 @@ jobs:
name: Bazel Build & Test Job
runs-on: ubuntu-latest
steps:
- name: Maximize build space
shell: bash
run: |
echo "Available storage before:"
df -h
echo "Removing /usr/share/dotnet, /usr/local/lib/android, /opt/ghc"
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo "Available storage after:"
df -h
- uses: ./.github/workflows/composite/maximize-build-space
- name: Check Out Repo
# This is necessary for overlays into the Docker container below.
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
Expand Down Expand Up @@ -157,17 +147,7 @@ jobs:
name: Bazel Package Job
runs-on: ubuntu-latest
steps:
- name: Maximize build space
shell: bash
run: |
echo "Available storage before:"
df -h
echo "Removing /usr/share/dotnet, /usr/local/lib/android, /opt/ghc"
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo "Available storage after:"
df -h
- uses: ./.github/workflows/composite/maximize-build-space
- name: Check Out Repo
# This is necessary for overlays into the Docker container below.
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/composite/maximize-build-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: maximize-build-space
description: Maximize build space on github runner

runs:
using: composite
steps:
- name: Maximize build space
shell: bash
run: |
echo "Available storage before:"
df -h
echo "Removing /usr/share/dotnet, /usr/local/lib/android, /opt/ghc"
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo "Available storage after:"
df -h
12 changes: 1 addition & 11 deletions .github/workflows/gcc-problems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,7 @@ jobs:
name: Build all Bazelified C/C++ targets
runs-on: ubuntu-latest
steps:
- name: Maximize build space
shell: bash
run: |
echo "Available storage before:"
df -h
echo "Removing /usr/share/dotnet, /usr/local/lib/android, /opt/ghc"
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo "Available storage after:"
df -h
- uses: ./.github/workflows/composite/maximize-build-space
- name: Check Out Repo
# This is necessary for overlays into the Docker container below.
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
Expand Down

0 comments on commit 8594fd9

Please sign in to comment.