This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new d7a415f022 Free more disk space on GitHub actions runner
d7a415f022 is described below

commit d7a415f022017dcb40d4d8d9fc77f3e8ad881fd0
Author: James Netherton <jamesnether...@gmail.com>
AuthorDate: Wed Dec 6 18:15:03 2023 +0000

    Free more disk space on GitHub actions runner
---
 .github/reclaim-disk-space.sh              | 43 ++++++++++++++++++++++++++++++
 .github/workflows/camel-master-cron.yaml   | 28 +++----------------
 .github/workflows/ci-build.yaml            | 28 +++----------------
 .github/workflows/quarkus-master-cron.yaml | 28 +++----------------
 4 files changed, 52 insertions(+), 75 deletions(-)

diff --git a/.github/reclaim-disk-space.sh b/.github/reclaim-disk-space.sh
new file mode 100755
index 0000000000..a1010b7197
--- /dev/null
+++ b/.github/reclaim-disk-space.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+echo "Free disk space before space reclaimed"
+df -h /
+
+echo "Reclaiming disk space..."
+
+# Unwanted development SDKs
+sudo rm -rf /opt/ghc \
+     rm -rf /opt/pipx \
+     rm -rf /usr/local/go \
+     rm -rf /usr/local/lib/android \
+     rm -rf /usr/local/share/boost \
+     rm -rf /usr/share/dotnet \
+     rm -rf /usr/share/rust \
+     rm -rf /usr/share/swift
+
+# Remove unwanted container images
+CONTAINER_IMAGES_TO_REMOVE=(node)
+for IMAGE in ${CONTAINER_IMAGES_TO_REMOVE[@]}; do
+    if [[ $(docker images ${IMAGE} -q | wc -l) > 0 ]]; then
+        docker rmi -f $(docker images ${IMAGE} -q)
+    fi
+done
+
+echo "Free disk space after space reclaimed"
+df -h /
diff --git a/.github/workflows/camel-master-cron.yaml 
b/.github/workflows/camel-master-cron.yaml
index 9985ccc8c4..b6c31cac47 100644
--- a/.github/workflows/camel-master-cron.yaml
+++ b/.github/workflows/camel-master-cron.yaml
@@ -128,19 +128,6 @@ jobs:
       fail-fast: false
       matrix: ${{ fromJson(needs.initial-mvn-install.outputs.matrix) }}
     steps:
-      - name: Reclaim Disk Space
-        run: |
-          df -h /
-          echo "Reclaiming disk space..."
-          sudo rm -rf /opt/ghc \
-               rm -rf /opt/pipx \
-               rm -rf /usr/local/go \
-               rm -rf /usr/local/lib/android \
-               rm -rf /usr/local/share/boost \
-               rm -rf /usr/share/dotnet \
-               rm -rf /usr/share/rust \
-               rm -rf /usr/share/swift
-          df -h /
       - name: Download Maven Repo
         uses: actions/download-artifact@v3
         with:
@@ -157,6 +144,8 @@ jobs:
         with:
           ref: camel-main
           fetch-depth: 0
+      - name: Reclaim Disk Space
+        run: .github/reclaim-disk-space.sh
       - name: Rebase branch main onto camel-main
         run: |
           git config --local user.email 
"41898282+github-actions[bot]@users.noreply.github.com"
@@ -347,18 +336,7 @@ jobs:
           ref: camel-main
           fetch-depth: 0
       - name: Reclaim Disk Space
-        run: |
-          df -h /
-          echo "Reclaiming disk space..."
-          sudo rm -rf /opt/ghc \
-               rm -rf /opt/pipx \
-               rm -rf /usr/local/go \
-               rm -rf /usr/local/lib/android \
-               rm -rf /usr/local/share/boost \
-               rm -rf /usr/share/dotnet \
-               rm -rf /usr/share/rust \
-               rm -rf /usr/share/swift
-          df -h /
+        run: .github/reclaim-disk-space.sh
       - name: Set up JDK 21
         uses: actions/setup-java@v4
         with:
diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml
index aeb0e75a46..28c28f4d3a 100644
--- a/.github/workflows/ci-build.yaml
+++ b/.github/workflows/ci-build.yaml
@@ -214,24 +214,13 @@ jobs:
         if: github.ref == 'refs/heads/quarkus-main' || github.base_ref == 
'quarkus-main'
         run: |
           echo "BRANCH_OPTIONS=-Poss-snapshots -Dquarkus.version=999-SNAPSHOT" 
>> $GITHUB_ENV
-      - name: Reclaim Disk Space
-        run: |
-          df -h /
-          echo "Reclaiming disk space..."
-          sudo rm -rf /opt/ghc \
-               rm -rf /opt/pipx \
-               rm -rf /usr/local/go \
-               rm -rf /usr/local/lib/android \
-               rm -rf /usr/local/share/boost \
-               rm -rf /usr/share/dotnet \
-               rm -rf /usr/share/rust \
-               rm -rf /usr/share/swift
-          df -h /
       - name: Checkout
         uses: actions/checkout@v4
         with:
           ref: ${{ env.CHECKOUT_REF }}
           fetch-depth: 0
+      - name: Reclaim Disk Space
+        run: .github/reclaim-disk-space.sh
       - name: Set up JDK 17
         uses: actions/setup-java@v4
         with:
@@ -417,18 +406,7 @@ jobs:
           ref: ${{ env.CHECKOUT_REF }}
           fetch-depth: 0
       - name: Reclaim Disk Space
-        run: |
-          df -h /
-          echo "Reclaiming disk space..."
-          sudo rm -rf /opt/ghc \
-               rm -rf /opt/pipx \
-               rm -rf /usr/local/go \
-               rm -rf /usr/local/lib/android \
-               rm -rf /usr/local/share/boost \
-               rm -rf /usr/share/dotnet \
-               rm -rf /usr/share/rust \
-               rm -rf /usr/share/swift
-          df -h /
+        run: .github/reclaim-disk-space.sh
       - name: Set up JDK 21
         uses: actions/setup-java@v4
         with:
diff --git a/.github/workflows/quarkus-master-cron.yaml 
b/.github/workflows/quarkus-master-cron.yaml
index ff55ced7ae..714ab124c1 100644
--- a/.github/workflows/quarkus-master-cron.yaml
+++ b/.github/workflows/quarkus-master-cron.yaml
@@ -129,19 +129,6 @@ jobs:
       fail-fast: false
       matrix: ${{ fromJson(needs.initial-mvn-install.outputs.matrix) }}
     steps:
-      - name: Reclaim Disk Space
-        run: |
-          df -h /
-          echo "Reclaiming disk space..."
-          sudo rm -rf /opt/ghc \
-               rm -rf /opt/pipx \
-               rm -rf /usr/local/go \
-               rm -rf /usr/local/lib/android \
-               rm -rf /usr/local/share/boost \
-               rm -rf /usr/share/dotnet \
-               rm -rf /usr/share/rust \
-               rm -rf /usr/share/swift
-          df -h /
       - name: Download Maven Repo
         uses: actions/download-artifact@v3
         with:
@@ -158,6 +145,8 @@ jobs:
         with:
           ref: quarkus-main
           fetch-depth: 0
+      - name: Reclaim Disk Space
+        run: .github/reclaim-disk-space.sh
       - name: Rebase branch main onto quarkus-main
         run: |
           git config --local user.email 
"41898282+github-actions[bot]@users.noreply.github.com"
@@ -348,18 +337,7 @@ jobs:
           ref: quarkus-main
           fetch-depth: 0
       - name: Reclaim Disk Space
-        run: |
-          df -h /
-          echo "Reclaiming disk space..."
-          sudo rm -rf /opt/ghc \
-               rm -rf /opt/pipx \
-               rm -rf /usr/local/go \
-               rm -rf /usr/local/lib/android \
-               rm -rf /usr/local/share/boost \
-               rm -rf /usr/share/dotnet \
-               rm -rf /usr/share/rust \
-               rm -rf /usr/share/swift
-          df -h /
+        run: .github/reclaim-disk-space.sh
       - name: Set up JDK 21
         uses: actions/setup-java@v4
         with:

Reply via email to