name: lint

on: [push, pull_request]

jobs:
  run-linters:
    name: Run linters
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - uses: actions/setup-python@v3
        with:
          python-version: 3.9
          cache: pip
          cache-dependency-path: requirements/lint.txt

      - name: Install linters
        run: python -m pip install -r requirements/lint.txt

      - name: Check imports
        run: >
          find src tests -name '*.py' -o -name '*.pyx' -o -name '*.pxd'
          | xargs python -m isort --check --diff
        if: always()

      - name: Check format
        run: find src tests -name '*.py' | xargs python -m black --check --diff
        if: always()

name: lint

on: [push, pull_request]

jobs:
  run-linters:
    name: Run linters
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - uses: actions/setup-python@v3
        with:
          python-version: 3.9
          cache: pip
          cache-dependency-path: requirements/lint.txt

      - name: Install linters
        run: python -m pip install -r requirements/lint.txt

      - name: Check imports
        run: >
          find src tests -name '*.py' -o -name '*.pyi' -o -name '*.pyx' -o -name '*.pxd'
          | xargs python -m isort --check --diff
        if: always()

      - name: Check format
        run: >
          find src tests -name '*.py' -o -name '*.pyi'
          | xargs python -m black --check --diff
        if: always()

Check pyi files with isort and black
ci: Check pyi files with isort and black
