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 2cc2f5e7d1 Fix case where we have empty mypy folder array in ci 
workflow (#38282)
2cc2f5e7d1 is described below

commit 2cc2f5e7d1307a02c5ed9cd96e7c5688dae622b1
Author: Jarek Potiuk <[email protected]>
AuthorDate: Tue Mar 19 14:22:34 2024 +0100

    Fix case where we have empty mypy folder array in ci workflow (#38282)
    
    When no python files change we have empty mypy-folders array.
    We have to skip the whole strategy matrix in this case.
---
 .github/workflows/mypy.yml | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml
index 9c64b68af2..061a87ae24 100644
--- a/.github/workflows/mypy.yml
+++ b/.github/workflows/mypy.yml
@@ -50,6 +50,7 @@ jobs:
       fail-fast: false
       matrix:
         mypy-folder: ${{fromJson(inputs.mypy-folders)}}
+    if: inputs.needs-mypy == 'true'
     env:
       RUNS_ON: "${{inputs.runs-on}}"
       PYTHON_MAJOR_MINOR_VERSION: "${{inputs.default-python-version}}"
@@ -59,19 +60,15 @@ jobs:
       - name: "Cleanup repo"
         shell: bash
         run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm 
-rf /workspace/*"
-        if: inputs.needs-mypy == 'true'
       - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
         uses: actions/checkout@v4
         with:
           persist-credentials: false
-        if: inputs.needs-mypy == 'true'
       - name: Cleanup docker
         uses: ./.github/actions/cleanup-docker
-        if: inputs.needs-mypy == 'true'
       - name: "Prepare breeze & CI image: ${{ inputs.default-python-version 
}}:${{ inputs.image-tag }}"
         uses: ./.github/actions/prepare_breeze_and_image
         id: breeze
-        if: inputs.needs-mypy == 'true'
       - name: "MyPy checks for ${{ matrix.mypy-folder }}"
         run: |
           pip install pre-commit
@@ -83,4 +80,3 @@ jobs:
           DEFAULT_BRANCH: ${{ inputs.default-branch }}
           RUFF_FORMAT: "github"
           INCLUDE_MYPY_VOLUME: "false"
-        if: inputs.needs-mypy == 'true'

Reply via email to