name: CI on: pull_request: branches: [main] push: branches: [main] # Cancel an in-flight run on the same branch when a newer push lands concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: lint: name: Lint (ruff + mypy) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.12' cache: pip - name: Install lint tools run: | python -m pip install --upgrade pip pip install ruff mypy - name: Ruff run: ruff check src/ tests/ - name: Mypy (library only) run: mypy --config-file mypy.ini src/guichetoi/cms.py src/guichetoi/recommendation.py test: name: Tests (pytest) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.12' cache: pip - name: System deps (tesseract-fra) run: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ tesseract-ocr tesseract-ocr-fra libgl1 libglib2.0-0 - name: Install package # `-e .` installs the package; `requirements.txt` pins exact versions run: | python -m pip install --upgrade pip pip install -e ".[dev]" - name: Pytest run: pytest -q