add doctor command, fix ISBN false positives, wire up CI
Some checks failed
tests / core (macos-latest, py3.11) (push) Has been cancelled
tests / core (macos-latest, py3.12) (push) Has been cancelled
tests / core (macos-latest, py3.13) (push) Has been cancelled
tests / core (ubuntu-latest, py3.11) (push) Has been cancelled
tests / core (ubuntu-latest, py3.12) (push) Has been cancelled
tests / core (ubuntu-latest, py3.13) (push) Has been cancelled
tests / doctor CLI smoke test (push) Has been cancelled
Some checks failed
tests / core (macos-latest, py3.11) (push) Has been cancelled
tests / core (macos-latest, py3.12) (push) Has been cancelled
tests / core (macos-latest, py3.13) (push) Has been cancelled
tests / core (ubuntu-latest, py3.11) (push) Has been cancelled
tests / core (ubuntu-latest, py3.12) (push) Has been cancelled
tests / core (ubuntu-latest, py3.13) (push) Has been cancelled
tests / doctor CLI smoke test (push) Has been cancelled
ISBN regex now requires an explicit prefix, so it stops matching years, URLs, job IDs, and dilution ratios. doctor checks the environment end to end: Python, Tesseract, PaddleOCR, the PyTorch backend, table/figure detectors, scispaCy, config, DB, output. CI runs on 2 OS x 3 Python versions plus a doctor smoke job. Also added a changelog
This commit is contained in:
65
.github/workflows/tests.yml
vendored
Normal file
65
.github/workflows/tests.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
name: tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
core:
|
||||
name: core (${{ matrix.os }}, py${{ matrix.python-version }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
python-version: ["3.11", "3.12", "3.13"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v3
|
||||
with:
|
||||
enable-cache: true
|
||||
cache-dependency-glob: "uv.lock"
|
||||
|
||||
- name: Set up Python
|
||||
run: uv python install ${{ matrix.python-version }}
|
||||
|
||||
- name: Sync core dependencies
|
||||
run: uv sync --frozen --all-extras
|
||||
|
||||
- name: Install Tesseract (Ubuntu)
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: sudo apt-get update && sudo apt-get install -y tesseract-ocr
|
||||
|
||||
- name: Install Tesseract (macOS)
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: brew install tesseract
|
||||
|
||||
- name: Run ruff
|
||||
run: uv run ruff check src/ tests/
|
||||
|
||||
- name: Check formatting
|
||||
run: uv run ruff format --check src/ tests/
|
||||
|
||||
- name: Run pytest
|
||||
run: uv run pytest tests/ -q --maxfail=1
|
||||
|
||||
doctor-smoke:
|
||||
name: doctor CLI smoke test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/setup-uv@v3
|
||||
- run: uv sync --frozen
|
||||
- name: Install Tesseract
|
||||
run: sudo apt-get update && sudo apt-get install -y tesseract-ocr
|
||||
- name: Run doctor
|
||||
run: uv run ocr-pipeline doctor
|
||||
Reference in New Issue
Block a user