From 2cc2f5e7d1307a02c5ed9cd96e7c5688dae622b1 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Tue, 19 Mar 2024 14:22:34 +0100 Subject: [PATCH] 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 9c64b68af2f443..061a87ae243142 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'