From 0f30a248e26c87a356f3d279dbac98fc519e5ad5 Mon Sep 17 00:00:00 2001 From: Martijn Pieters Date: Thu, 7 Dec 2023 16:07:01 +0000 Subject: [PATCH] CI: Verify public API types with pyright --- .github/workflows/tests.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7be1ea4..aaaf795 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,3 +43,27 @@ jobs: uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} + + typesafety: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + cache: 'pip' + + - run: | + python -m venv .venv + source .venv/bin/activate + # Tell setuptools to *not* create a PEP 660 import hook and to use + # symlinks instead, # so that pyright can still find the package. See + # https://microsoft.github.io/pyright/#/import-resolution?id=editable-installs + pip install --editable . --config-settings editable_mode=strict + + - run: echo "$PWD/.venv/bin" >> $GITHUB_PATH + + - uses: jakebailey/pyright-action@v1 + with: + ignore-external: true + verify-types: "aocd"