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

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new bc7b68b83a Move cleanup-docker to a shell scripts from composite 
action (#38659)
bc7b68b83a is described below

commit bc7b68b83a254f9c212984fca64072c9e3fa3d15
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Tue Apr 2 00:40:31 2024 +0200

    Move cleanup-docker to a shell scripts from composite action (#38659)
    
    Cleaning up docker is a single bash script to execute - it is defined
    as a composite action but since it's just one bash commenad to execute,
    it is better to just keep it as a bash script instead - which wil make
    it easier to add other scripts.
---
 .github/workflows/additional-ci-image-checks.yml   |  4 ++--
 .github/workflows/additional-prod-image-tests.yml  |  8 ++++----
 .github/workflows/basic-tests.yml                  | 24 +++++++++++-----------
 .github/workflows/build-images.yml                 |  4 ++--
 .github/workflows/check-providers.yml              | 12 +++++------
 .github/workflows/ci-image-build.yml               |  4 ++--
 .github/workflows/ci.yml                           | 12 +++++------
 .github/workflows/finalize-tests.yml               |  8 ++++----
 .github/workflows/generate-constraints.yml         |  4 ++--
 .github/workflows/helm-tests.yml                   |  8 ++++----
 .github/workflows/integration-tests.yml            |  4 ++--
 .github/workflows/k8s-tests.yml                    |  4 ++--
 .github/workflows/prod-image-build.yml             |  8 ++++----
 .github/workflows/push-image-cache.yml             |  8 ++++----
 .github/workflows/release_dockerhub_image.yml      |  8 ++++----
 .github/workflows/run-unit-tests.yml               |  4 ++--
 .github/workflows/static-checks-mypy-docs.yml      | 12 +++++------
 .../action.yml => scripts/ci/cleanup_docker.sh     | 16 ++++++---------
 18 files changed, 74 insertions(+), 78 deletions(-)

diff --git a/.github/workflows/additional-ci-image-checks.yml 
b/.github/workflows/additional-ci-image-checks.yml
index 25ecd5f952..7d0eb88d24 100644
--- a/.github/workflows/additional-ci-image-checks.yml
+++ b/.github/workflows/additional-ci-image-checks.yml
@@ -136,8 +136,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
       - name: "Login to ghcr.io"
diff --git a/.github/workflows/additional-prod-image-tests.yml 
b/.github/workflows/additional-prod-image-tests.yml
index 500a4371a6..9d96319311 100644
--- a/.github/workflows/additional-prod-image-tests.yml
+++ b/.github/workflows/additional-prod-image-tests.yml
@@ -107,8 +107,8 @@ jobs:
         with:
           fetch-depth: 2
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
       - name: Login to ghcr.io
@@ -153,8 +153,8 @@ jobs:
         with:
           fetch-depth: 2
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
       - name: Login to ghcr.io
diff --git a/.github/workflows/basic-tests.yml 
b/.github/workflows/basic-tests.yml
index eea256b6a2..db84bae38e 100644
--- a/.github/workflows/basic-tests.yml
+++ b/.github/workflows/basic-tests.yml
@@ -66,8 +66,8 @@ jobs:
           # Need to fetch all history for selective checks tests
           fetch-depth: 0
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - uses: actions/setup-python@v5
         with:
           python-version: "${{ inputs.default-python-version }}"
@@ -90,8 +90,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Setup node"
         uses: actions/setup-node@v4
         with:
@@ -120,8 +120,8 @@ jobs:
         with:
           fetch-depth: 2
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
         uses: actions/checkout@v4
         with:
@@ -209,8 +209,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Setup python"
         uses: actions/setup-python@v5
         with:
@@ -278,8 +278,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       # Install python from scratch. No cache used. We always want to have 
fresh version of everything
       - uses: actions/setup-python@v5
         with:
@@ -350,8 +350,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
       - name: "Cleanup dist files"
diff --git a/.github/workflows/build-images.yml 
b/.github/workflows/build-images.yml
index e9104effee..d19e9572c7 100644
--- a/.github/workflows/build-images.yml
+++ b/.github/workflows/build-images.yml
@@ -133,8 +133,8 @@ jobs:
       #  COMPOSITE ACTIONS. WE CAN RUN ANYTHING THAT IS IN THE TARGET BRANCH 
AND THERE IS NO RISK THAT
       #  CODE WILL BE RUN FROM THE PR.
       
####################################################################################################
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Setup python"
         uses: actions/setup-python@v5
         with:
diff --git a/.github/workflows/check-providers.yml 
b/.github/workflows/check-providers.yml
index 839b310046..d71b8d678d 100644
--- a/.github/workflows/check-providers.yml
+++ b/.github/workflows/check-providers.yml
@@ -75,8 +75,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: >
           Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ 
inputs.image-tag }}
         uses: ./.github/actions/prepare_breeze_and_image
@@ -140,8 +140,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: >
           Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ 
inputs.image-tag }}
         uses: ./.github/actions/prepare_breeze_and_image
@@ -214,8 +214,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Prepare breeze & CI image: ${{ matrix.python-version }}:${{ 
inputs.image-tag }}"
         uses: ./.github/actions/prepare_breeze_and_image
       - name: "Cleanup dist files"
diff --git a/.github/workflows/ci-image-build.yml 
b/.github/workflows/ci-image-build.yml
index 5864eea6a9..cd11376a82 100644
--- a/.github/workflows/ci-image-build.yml
+++ b/.github/workflows/ci-image-build.yml
@@ -182,8 +182,8 @@ ${{ inputs.do-build == 'true' && inputs.image-tag || '' }}"
       #  BE RUN SAFELY AS PART OF DOCKER BUILD. BECAUSE IT RUNS INSIDE THE 
DOCKER CONTAINER AND IT IS
       #  ISOLATED FROM THE RUNNER.
       
####################################################################################################
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
         if: inputs.do-build == 'true'
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0fd4a3b5cd..39fbbd7811 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -128,8 +128,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: Fetch incoming commit ${{ github.sha }} with its parent
         uses: actions/checkout@v4
         with:
@@ -216,8 +216,8 @@ jobs:
         with:
           persist-credentials: false
         if: needs.build-info.outputs.in-workflow-build == 'false'
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
         if: needs.build-info.outputs.in-workflow-build == 'false'
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
@@ -534,8 +534,8 @@ jobs:
         with:
           persist-credentials: false
         if: needs.build-info.outputs.in-workflow-build == 'false'
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
         if: needs.build-info.outputs.in-workflow-build == 'false'
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
diff --git a/.github/workflows/finalize-tests.yml 
b/.github/workflows/finalize-tests.yml
index 8b61225400..5a3398d6a0 100644
--- a/.github/workflows/finalize-tests.yml
+++ b/.github/workflows/finalize-tests.yml
@@ -98,8 +98,8 @@ jobs:
         with:
           # Needed to perform push action
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Set constraints branch name"
         id: constraints-branch
         run: ./scripts/ci/constraints/ci_branch_constraints.sh >> 
${GITHUB_OUTPUT}
@@ -185,8 +185,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Download all artifacts from the current build"
         uses: actions/download-artifact@v4
         with:
diff --git a/.github/workflows/generate-constraints.yml 
b/.github/workflows/generate-constraints.yml
index 57621102f8..207fd4339c 100644
--- a/.github/workflows/generate-constraints.yml
+++ b/.github/workflows/generate-constraints.yml
@@ -69,8 +69,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
       - name: Login to ghcr.io
diff --git a/.github/workflows/helm-tests.yml b/.github/workflows/helm-tests.yml
index 0c18472648..8b26769ff4 100644
--- a/.github/workflows/helm-tests.yml
+++ b/.github/workflows/helm-tests.yml
@@ -70,8 +70,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Prepare breeze & CI image: 
${{inputs.default-python-version}}:${{inputs.image-tag}}"
         uses: ./.github/actions/prepare_breeze_and_image
       - name: "Helm Unit Tests: ${{ matrix.helm-test-package }}"
@@ -91,8 +91,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
       - name: Setup git for tagging
diff --git a/.github/workflows/integration-tests.yml 
b/.github/workflows/integration-tests.yml
index 054b745cb7..57aa4efa46 100644
--- a/.github/workflows/integration-tests.yml
+++ b/.github/workflows/integration-tests.yml
@@ -97,8 +97,8 @@ jobs:
         with:
           persist-credentials: false
         if: inputs.is-airflow-runner == 'true' || matrix.backend == 'postgres'
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
         if: inputs.is-airflow-runner == 'true' || matrix.backend == 'postgres'
       - name: "Prepare breeze & CI image: ${{ inputs.default-python-version 
}}:${{ inputs.image-tag }}"
         uses: ./.github/actions/prepare_breeze_and_image
diff --git a/.github/workflows/k8s-tests.yml b/.github/workflows/k8s-tests.yml
index 74a40db287..ad0f3ece46 100644
--- a/.github/workflows/k8s-tests.yml
+++ b/.github/workflows/k8s-tests.yml
@@ -76,8 +76,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
         id: breeze
diff --git a/.github/workflows/prod-image-build.yml 
b/.github/workflows/prod-image-build.yml
index 37ef43259a..5643724a8b 100644
--- a/.github/workflows/prod-image-build.yml
+++ b/.github/workflows/prod-image-build.yml
@@ -132,8 +132,8 @@ jobs:
         with:
           persist-credentials: false
         if: inputs.do-build == 'true' && inputs.upload-package-artifact == 
'true'
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
         if: inputs.do-build == 'true' && inputs.upload-package-artifact == 
'true'
       - uses: actions/setup-python@v5
         with:
@@ -268,8 +268,8 @@ ${{ inputs.do-build == 'true' && inputs.image-tag || '' }}"
       #  BE RUN SAFELY AS PART OF DOCKER BUILD. BECAUSE IT RUNS INSIDE THE 
DOCKER CONTAINER AND IT IS
       #  ISOLATED FROM THE RUNNER.
       
####################################################################################################
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
         if: inputs.do-build == 'true'
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
diff --git a/.github/workflows/push-image-cache.yml 
b/.github/workflows/push-image-cache.yml
index 83152426ea..becd7165aa 100644
--- a/.github/workflows/push-image-cache.yml
+++ b/.github/workflows/push-image-cache.yml
@@ -117,8 +117,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
       - name: "Start ARM instance"
@@ -179,8 +179,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
       - name: "Cleanup dist and context file"
diff --git a/.github/workflows/release_dockerhub_image.yml 
b/.github/workflows/release_dockerhub_image.yml
index d489feae94..d45aa2c4be 100644
--- a/.github/workflows/release_dockerhub_image.yml
+++ b/.github/workflows/release_dockerhub_image.yml
@@ -59,8 +59,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
       - name: Selective checks
@@ -94,8 +94,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Install Breeze"
         uses: ./.github/actions/breeze
       - name: Free space
diff --git a/.github/workflows/run-unit-tests.yml 
b/.github/workflows/run-unit-tests.yml
index 65ff069488..c133883752 100644
--- a/.github/workflows/run-unit-tests.yml
+++ b/.github/workflows/run-unit-tests.yml
@@ -149,8 +149,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Prepare breeze & CI image: ${{matrix.python-version}}:${{ 
inputs.image-tag }}"
         uses: ./.github/actions/prepare_breeze_and_image
       - name: >
diff --git a/.github/workflows/static-checks-mypy-docs.yml 
b/.github/workflows/static-checks-mypy-docs.yml
index bde5dd1b61..f517eb6a97 100644
--- a/.github/workflows/static-checks-mypy-docs.yml
+++ b/.github/workflows/static-checks-mypy-docs.yml
@@ -113,8 +113,8 @@ jobs:
           python-version: ${{ inputs.default-python-version }}
           cache: 'pip'
           cache-dependency-path: ./dev/breeze/pyproject.toml
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Prepare breeze & CI image: ${{ 
inputs.default-python-version}}:${{ inputs.image-tag }}"
         uses: ./.github/actions/prepare_breeze_and_image
         id: breeze
@@ -157,8 +157,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Prepare breeze & CI image: ${{ inputs.default-python-version 
}}:${{ inputs.image-tag }}"
         uses: ./.github/actions/prepare_breeze_and_image
         id: breeze
@@ -199,8 +199,8 @@ jobs:
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-      - name: Cleanup docker
-        uses: ./.github/actions/cleanup-docker
+      - name: "Cleanup docker"
+        run: ./scripts/ci/cleanup_docker.sh
       - name: "Prepare breeze & CI image: ${{ inputs.default-python-version 
}}:${{ inputs.image-tag }}"
         uses: ./.github/actions/prepare_breeze_and_image
       - uses: actions/cache@v4
diff --git a/.github/actions/cleanup-docker/action.yml 
b/scripts/ci/cleanup_docker.sh
old mode 100644
new mode 100755
similarity index 79%
rename from .github/actions/cleanup-docker/action.yml
rename to scripts/ci/cleanup_docker.sh
index fa64e5b264..039b462279
--- a/.github/actions/cleanup-docker/action.yml
+++ b/scripts/ci/cleanup_docker.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env 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
@@ -14,13 +15,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
----
-name: 'Cleanup docker'
-description: 'Cleans up docker'
-runs:
-  using: "composite"
-  steps:
-    - name: "Cleanup docker"
-      shell: bash
-      run: docker system prune --all --force --volumes
+function cleanup_docker {
+    docker system prune --all --force --volumes
+}
+
+cleanup_docker

Reply via email to