Skip to content

Commit

Permalink
ci: Create composite action for maximizing the build space (magma#13341)
Browse files Browse the repository at this point in the history
Signed-off-by: Lars Kreutzer <lars.kreutzer@tngtech.com>
  • Loading branch information
LKreutzer authored and emakeev committed Aug 5, 2022
1 parent 53e74a3 commit a85e6cd
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 55 deletions.
26 changes: 4 additions & 22 deletions .github/workflows/agw-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,11 @@ 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
- name: Check Out Repo
# This is necessary for overlays into the Docker container below.
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- name: Maximize build space
uses: ./.github/workflows/composite/maximize-build-space
- name: Setup Bazel Base Image
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
Expand Down Expand Up @@ -339,20 +330,11 @@ 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
- name: Check Out Repo
# This is necessary for overlays into the Docker container below.
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- name: Maximize build space
uses: ./.github/workflows/composite/maximize-build-space
- name: Setup Devcontainer Image
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
Expand Down
26 changes: 4 additions & 22 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,11 @@ 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
- name: Check Out Repo
# This is necessary for overlays into the Docker container below.
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- name: Maximize build space
uses: ./.github/workflows/composite/maximize-build-space
- name: Setup Bazel Base Image
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
Expand Down Expand Up @@ -157,20 +148,11 @@ 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
- name: Check Out Repo
# This is necessary for overlays into the Docker container below.
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- name: Maximize build space
uses: ./.github/workflows/composite/maximize-build-space
- name: Setup Bazel Base Image
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/composite/maximize-build-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: maximize-build-space
description: Maximize build space on Github runner
# This local action is simpler than existing external
# actions that try to clean up the Github runner.

runs:
using: composite
steps:
- name: Maximize build space
shell: bash
run: |
echo "Available storage before:"
df -h --total
echo "Removing /usr/share/dotnet, /usr/local/lib/android, /opt/ghc"
sudo rm -rf \
/usr/share/dotnet \
/usr/local/lib/android \
/opt/ghc
echo "Available storage after:"
df -h --total
13 changes: 2 additions & 11 deletions .github/workflows/gcc-problems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,11 @@ 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
- name: Check Out Repo
# This is necessary for overlays into the Docker container below.
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # pin@v2
- name: Maximize build space
uses: ./.github/workflows/composite/maximize-build-space
- name: Setup Bazel Base Image
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # pin@v3
with:
Expand Down

0 comments on commit a85e6cd

Please sign in to comment.