@@ -26,14 +26,73 @@ jobs:
2626 with :
2727 path : ~/.cache/huggingface
2828 key : huggingface-cache-py${{ matrix.python-version }}
29- - uses : ./.github/actions/setup-poetry
29+ - name : Install uv and set the python version
30+ uses : astral-sh/setup-uv@v5
3031 with :
3132 python-version : ${{ matrix.python-version }}
32- - name : Run styling check
33- run : poetry run pre-commit run --all-files
33+ enable-cache : true
34+ - name : pre-commit cache key
35+ run : echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV"
36+ - uses : actions/cache@v4
37+ with :
38+ path : ~/.cache/pre-commit
39+ key : pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
40+ - name : Install dependencies
41+ run : uv sync --frozen --all-extras
42+ - name : Check style and run tests
43+ run : pre-commit run --all-files
3444 - name : Upload coverage to Codecov
3545 if : inputs.push_coverage
3646 uses : codecov/codecov-action@v5
3747 with :
3848 token : ${{ secrets.CODECOV_TOKEN }}
3949 files : ./coverage.xml
50+
51+ build-package :
52+ runs-on : ubuntu-latest
53+ strategy :
54+ matrix :
55+ python-version : ['3.12']
56+ steps :
57+ - uses : actions/checkout@v4
58+ - name : Install uv and set the python version
59+ uses : astral-sh/setup-uv@v5
60+ with :
61+ python-version : ${{ matrix.python-version }}
62+ enable-cache : true
63+ - name : Install dependencies
64+ run : uv sync --all-extras
65+ - name : Build package
66+ run : uv build
67+ - name : Check content of wheel
68+ run : unzip -l dist/*.whl
69+ - name : Store the distribution packages
70+ uses : actions/upload-artifact@v4
71+ with :
72+ name : python-package-distributions
73+ path : dist/
74+
75+ test-package :
76+ needs :
77+ - build-package
78+ runs-on : ubuntu-latest
79+ strategy :
80+ matrix :
81+ python-version : ['3.12']
82+ steps :
83+ - name : Download all the dists
84+ uses : actions/download-artifact@v4
85+ with :
86+ name : python-package-distributions
87+ path : dist/
88+ - name : Install uv and set the python version
89+ uses : astral-sh/setup-uv@v5
90+ with :
91+ python-version : ${{ matrix.python-version }}
92+ enable-cache : true
93+ - name : Install package
94+ run : uv pip install dist/*.whl
95+ - name : Load the DoclingDocument package
96+ run : python -c 'from docling_core.types.doc import DoclingDocument'
97+ - name : Check if package data is present
98+ run : python -c 'from importlib import resources; from pathlib import Path; p=Path(resources.files("docling_core").joinpath("resources/schemas/doc/DOC.json")); assert p.exists()'
0 commit comments