diff --git a/.github/workflows/mypy-presubmit.yml b/.github/workflows/mypy-presubmit.yml new file mode 100644 index 00000000000..fa3d6799155 --- /dev/null +++ b/.github/workflows/mypy-presubmit.yml @@ -0,0 +1,30 @@ +name: mypy-presubmit + +on: + pull_request: + paths: + - "samples/python/**" + - ".github/workflows/mypy-presubmit.yml" + +jobs: + type-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install mypy + pip install -r samples/python/requirements.txt || true + + - name: Run mypy on samples + run: | + mypy samples/python --ignore-missing-imports