Skip to content

fix: Enable mypy in the CI #1130

fix: Enable mypy in the CI

fix: Enable mypy in the CI #1130

Workflow file for this run

# Contrinuous Integration for the core package
name: lint
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
python:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Env
uses: ./.github/actions/setup-env
with:
python-version: "3.9" # the pre-commit is hooked in as 3.9
- name: Install Python dependencies
run: poetry install --no-interaction
- name: Execute pre-commit handler
run: |
poetry run pre-commit run check-toml
poetry run pre-commit run trailing-whitespace
poetry run pre-commit run end-of-file-fixer
poetry run pre-commit run ruff
poetry run pre-commit run ruff-format
- name: Execute mypy
run: |
poetry run mypy --config-file pyproject.toml core > mypy.log 2>&1
if [ -s mypy.log ]; then
cat mypy.log
echo "Mypy issues found. Generating report...";
cat mypy.log | poetry run python scripts/mypy_report.py
exit 1
else
echo "No mypy issues found.";
fi