on:
  push:
    branches: "**"

jobs:
  pylint:
    runs-on: docker
    container: forgejo.neshweb.net/ci-docker-images/python-neshweb:3.11
    steps:
      - name: Checkout source code
        uses: actions/checkout@v4
      - name: Install packages
        run: |
          pip install -e .[lint] --disable-pip-version-check --no-cache-dir -q
          python -m pip list --format=columns --disable-pip-version-check
      - name: Run pylint
        run: |
          pylint --version
          pylint **/*.py --exit-zero --rc-file pyproject.toml

  mypy:
    runs-on: docker
    container: forgejo.neshweb.net/ci-docker-images/python-neshweb:3.11
    steps:
      - name: Checkout source code
        uses: actions/checkout@v4
      - name: Install packages
        run: |
          pip install -e .[typing] --disable-pip-version-check --no-cache-dir -q
          python -m pip list --format=columns --disable-pip-version-check
      - name: Run mypy
        run: |
          mypy --version
          mypy .

  tests:
    runs-on: docker
    strategy:
      matrix:
        python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
    steps:
      - name: Checkout source code
        uses: actions/checkout@v4
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install packages
        run: |
          python --version
          pip install -e .[testing] --disable-pip-version-check --no-cache-dir -q
          python -m pip list --format=columns --disable-pip-version-check
      - name: Run pytest
        run: |
          pytest