From cdcd4a5ce5311d283ef0591b1746695e5d5b72f7 Mon Sep 17 00:00:00 2001 From: Arthur Chan Date: Wed, 12 Jun 2024 14:25:33 +0000 Subject: [PATCH] Add new CI for running mypy and pyright on webapp tool Signed-off-by: Arthur Chan --- .github/workflows/webapp-mypy.yml | 35 +++++++++++++++++++ .../.pyrightconfig.json | 8 +++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/webapp-mypy.yml create mode 100644 tools/web-fuzzing-introspection/.pyrightconfig.json diff --git a/.github/workflows/webapp-mypy.yml b/.github/workflows/webapp-mypy.yml new file mode 100644 index 000000000..d324ec2f0 --- /dev/null +++ b/.github/workflows/webapp-mypy.yml @@ -0,0 +1,35 @@ +name: Mypy-Pyright-webapp + +on: + pull_request: + branches: + main + paths: + - 'tools/web-fuzzing-introspection/**' + - '.github/workflows/webapp-mypy.yml' +permissions: read-all +jobs: + build: + runs-on: ubuntu-latest + name: Mypy-Pyright-webapp + steps: + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v2.4.0 + - name: Set up Python 3.8 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v3.0.0 + with: + python-version: 3.8 + - name: Install venv + run: sudo apt-get install python3-venv + - name: Set up venv + run: cd tools/web-fuzzing-introspection && python3 -m venv .venv + - name: Active venv dependencies + run: cd tools/web-fuzzing-introspection && source .venv/bin/activate && pip install -r ./requirements.txt + - name: Install Dependencies + run: | + pip install mypy types-PyYAML pyright types-requests + - name: mypy + run: | + cd tools/web-fuzzing-introspection && mypy --ignore-missing-imports --explicit-package-bases . + - name: pyright + run: | + cd tools/web-fuzzing-introspection && source .venv/bin/activate && pyright . --project=./.pyrightconfig.json --venvpath=./.venv diff --git a/tools/web-fuzzing-introspection/.pyrightconfig.json b/tools/web-fuzzing-introspection/.pyrightconfig.json new file mode 100644 index 000000000..04b6ee85c --- /dev/null +++ b/tools/web-fuzzing-introspection/.pyrightconfig.json @@ -0,0 +1,8 @@ +{ + "exclude": [ + "venv/", + ".venv/", + "requirements.txt", + ".venv", + ] +}