Skip to content

Commit

Permalink
add python lint type format
Browse files Browse the repository at this point in the history
  • Loading branch information
john0isaac committed May 5, 2024
1 parent 12ab5da commit 55e50a0
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-types-lint-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run Python linter and formatter

on:
push:
branches: [ main ]
paths:
- '**.py'

pull_request:
branches: [ main ]
paths:
- '**.py'

permissions:
contents: read

jobs:
python-types-lint-format:
name: Python ${{ matrix.python_version }} - ${{ matrix.test}} Check - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python_version: [3.8, 3.9, 3.10, 3.11, 3.12]
test: [types, lint, format]
command: ["mypy .", "ruff check .", "black ."]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
architecture: x64
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -e '.[dev]'
- name: Run ${{ matrix.test }} check
run: python -m ${{ matrix.command }}

0 comments on commit 55e50a0

Please sign in to comment.