Type Check and Lint #4260
Workflow file for this run
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: Type Check and Lint | |
on: [push, pull_request, workflow_dispatch] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
pylint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "pip" | |
cache-dependency-path: "requirements/dev.txt" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/dev.txt | |
- name: Setup cache | |
id: cache-pylint | |
uses: actions/cache@v4 | |
with: | |
path: .pylint.d | |
key: pylint | |
- name: Analyse code with pylint | |
run: | | |
pylint discord/ --exit-zero | |
mypy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: "pip" | |
cache-dependency-path: "requirements/dev.txt" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements/dev.txt | |
- name: Setup cache | |
id: cache-mypy | |
uses: actions/cache@v4 | |
with: | |
path: .mypy_cache | |
key: mypy | |
- name: Make mypy cache directory | |
run: mkdir -p -v .mypy_cache | |
- name: Run type checks with Mypy | |
run: mypy --non-interactive discord/ |