Skip to content

Commit 2cc2f5e

Browse files
authored
Fix case where we have empty mypy folder array in ci workflow (apache#38282)
When no python files change we have empty mypy-folders array. We have to skip the whole strategy matrix in this case.
1 parent 73eaaed commit 2cc2f5e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

.github/workflows/mypy.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
fail-fast: false
5151
matrix:
5252
mypy-folder: ${{fromJson(inputs.mypy-folders)}}
53+
if: inputs.needs-mypy == 'true'
5354
env:
5455
RUNS_ON: "${{inputs.runs-on}}"
5556
PYTHON_MAJOR_MINOR_VERSION: "${{inputs.default-python-version}}"
@@ -59,19 +60,15 @@ jobs:
5960
- name: "Cleanup repo"
6061
shell: bash
6162
run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
62-
if: inputs.needs-mypy == 'true'
6363
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
6464
uses: actions/checkout@v4
6565
with:
6666
persist-credentials: false
67-
if: inputs.needs-mypy == 'true'
6867
- name: Cleanup docker
6968
uses: ./.github/actions/cleanup-docker
70-
if: inputs.needs-mypy == 'true'
7169
- name: "Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }}"
7270
uses: ./.github/actions/prepare_breeze_and_image
7371
id: breeze
74-
if: inputs.needs-mypy == 'true'
7572
- name: "MyPy checks for ${{ matrix.mypy-folder }}"
7673
run: |
7774
pip install pre-commit
@@ -83,4 +80,3 @@ jobs:
8380
DEFAULT_BRANCH: ${{ inputs.default-branch }}
8481
RUFF_FORMAT: "github"
8582
INCLUDE_MYPY_VOLUME: "false"
86-
if: inputs.needs-mypy == 'true'

0 commit comments

Comments
 (0)