From 78f26faebe74f4e20b860d21e09bf093e33c734c Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Sun, 4 Aug 2024 12:18:04 +0200 Subject: [PATCH] github: add mypy workflow This will run mypy only on changed files --- .github/workflows/mypy.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/mypy.yml diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml new file mode 100644 index 000000000..ed8d2101a --- /dev/null +++ b/.github/workflows/mypy.yml @@ -0,0 +1,23 @@ +name: "mypy check" +on: [pull_request] + +jobs: + + static-type-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v3 + with: + python-version: '3.x' + - run: pip install mypy + - name: Get Python changed files + id: changed-py-files + uses: tj-actions/changed-files@v23 + with: + files: | + *.py + **/*.py + - name: Run if any of the listed files above is changed + if: steps.changed-py-files.outputs.any_changed == 'true' + run: mypy ${{ steps.changed-py-files.outputs.all_changed_files }}