ops: Add mypy and pyright to the code quality workflow

This commit is contained in:
Karim shoair
2026-02-07 17:28:44 +02:00
parent 16852cb1ac
commit b1ce0b414b
2 changed files with 48 additions and 2 deletions
+35 -1
View File
@@ -51,7 +51,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bandit[toml] ruff vermin
pip install bandit[toml] ruff vermin mypy pyright
pip install -e ".[all]"
pip install lxml-stubs
- name: Run Bandit (Security Linter)
id: bandit
@@ -86,6 +88,22 @@ jobs:
vermin -t=3.10- --violations --eval-annotations --no-tips scrapling/
echo "::endgroup::"
- name: Run Mypy (Static Type Checker)
id: mypy
continue-on-error: true
run: |
echo "::group::Mypy - Static Type Checker"
mypy scrapling/
echo "::endgroup::"
- name: Run Pyright (Static Type Checker)
id: pyright
continue-on-error: true
run: |
echo "::group::Pyright - Static Type Checker"
pyright scrapling/
echo "::endgroup::"
- name: Check results and create summary
if: always()
run: |
@@ -127,6 +145,22 @@ jobs:
all_passed=false
fi
# Check Mypy
if [ "${{ steps.mypy.outcome }}" == "success" ]; then
echo "✅ **Mypy (Type Checker)**: Passed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Mypy (Type Checker)**: Failed" >> $GITHUB_STEP_SUMMARY
all_passed=false
fi
# Check Pyright
if [ "${{ steps.pyright.outcome }}" == "success" ]; then
echo "✅ **Pyright (Type Checker)**: Passed" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Pyright (Type Checker)**: Failed" >> $GITHUB_STEP_SUMMARY
all_passed=false
fi
echo "" >> $GITHUB_STEP_SUMMARY
if [ "$all_passed" == "true" ]; then