on: workflow_call: inputs: push_coverage: type: boolean description: "If true, the coverage results are pushed to codecov.io." default: true secrets: CODECOV_TOKEN: required: false env: HF_HUB_DOWNLOAD_TIMEOUT: "60" HF_HUB_ETAG_TIMEOUT: "60" jobs: run-checks: runs-on: ubuntu-latest strategy: matrix: python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - uses: actions/checkout@v4 - name: Cache Hugging Face models uses: actions/cache@v4 with: path: ~/.cache/huggingface key: huggingface-cache-py${{ matrix.python-version }} - name: Install uv and set the python version uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} enable-cache: true - name: pre-commit cache key run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV" - uses: actions/cache@v4 with: path: ~/.cache/pre-commit key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - name: Install dependencies run: uv sync --frozen --all-extras --all-packages - name: Check style and run tests run: pre-commit run --all-files - name: Upload coverage to Codecov if: inputs.push_coverage uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage.xml build-package: runs-on: ubuntu-latest strategy: matrix: python-version: ['3.12'] steps: - uses: actions/checkout@v4 - name: Install uv and set the python version uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} enable-cache: true - name: Install dependencies run: uv sync --frozen --all-extras --all-packages - name: Build packages run: bash .github/scripts/build-packages.sh - name: Check content of wheels run: unzip -l dist/docling-core/*.whl && unzip -l dist/dclq/*.whl - name: Store the distribution packages uses: actions/upload-artifact@v4 with: name: python-package-distributions path: dist/ test-package: needs: - build-package runs-on: ubuntu-latest strategy: matrix: python-version: ['3.12'] steps: - name: Download all the dists uses: actions/download-artifact@v4 with: name: python-package-distributions path: dist/ - name: Install uv and set the python version uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} enable-cache: true # Installing both wheels together, offline for the two local packages, is # what validates the co-release: dclq's exact `docling-core==` pin can # only resolve against the docling-core wheel built from this same commit. - name: Install packages run: uv pip install dist/docling-core/*.whl dist/dclq/*.whl - name: Load the DoclingDocument package run: python -c 'from docling_core.types.doc import DoclingDocument' - name: Run the dclq CLI run: python -m dclq --help