Skip to content

Commit

Permalink
Fix case where we have empty mypy folder array in ci workflow (apache…
Browse files Browse the repository at this point in the history
…#38282)

When no python files change we have empty mypy-folders array.
We have to skip the whole strategy matrix in this case.
  • Loading branch information
potiuk authored Mar 19, 2024
1 parent 73eaaed commit 2cc2f5e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
Expand All @@ -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
Expand All @@ -83,4 +80,3 @@ jobs:
DEFAULT_BRANCH: ${{ inputs.default-branch }}
RUFF_FORMAT: "github"
INCLUDE_MYPY_VOLUME: "false"
if: inputs.needs-mypy == 'true'

0 comments on commit 2cc2f5e

Please sign in to comment.