MyPy #9187
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MyPy | |
on: | |
push: | |
paths: | |
- "**" | |
- "!controller/builds/**" | |
- "!.github/workflows/docker-build.yml" | |
pull_request: | |
paths: | |
- "**" | |
- "!controller/builds/**" | |
- "!.github/workflows/docker-build.yml" | |
workflow_dispatch: | |
# Cancel previous running jobs on the same branch in case of new pushs | |
concurrency: | |
group: do-mypy-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
mypy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install MyPy and pre-commit | |
run: | | |
python -m pip install --upgrade pip pre-commit | |
pip install --upgrade --no-cache-dir --editable .[types] | |
- name: Run MyPy | |
run: | | |
mypy --txt-report report --html-report report controller/ | |
cat report/index.txt | |
- name: Save Report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mypy-report | |
path: report | |
- name: Run Pre-commit | |
run: | | |
export GITGUARDIAN_API_KEY=${{ secrets.GITGUARDIAN_API_KEY }} | |
pre-commit run --all |