From 55e50a00e3c2a09ee8e92879ee2c4052a7f1393d Mon Sep 17 00:00:00 2001 From: John Aziz Date: Sun, 5 May 2024 19:08:33 +0000 Subject: [PATCH] add python lint type format --- .../workflows/python-types-lint-format.yaml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/python-types-lint-format.yaml diff --git a/.github/workflows/python-types-lint-format.yaml b/.github/workflows/python-types-lint-format.yaml new file mode 100644 index 0000000..cb57c3d --- /dev/null +++ b/.github/workflows/python-types-lint-format.yaml @@ -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 }}