Adds OCR performance evaluation code #98
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| paths-ignore: | |
| - "**.md" | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| env: | |
| PYTHON_ENV: test | |
| HOST_DATA_FOLDER: ${{ github.workspace }}/tests/data/single_synthetic_doc | |
| services: | |
| docker: | |
| image: docker:24.0.5 | |
| options: --privileged | |
| strategy: | |
| matrix: | |
| python-version: | |
| # - "3.11" | |
| - "3.12" | |
| # - "3.13" | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: Cache docker/setup-buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Disk Usage - initial size | |
| run: | | |
| echo "Disk usage summary:" | |
| df -h | |
| echo "" | |
| echo "Workspace usage:" | |
| du -sh $GITHUB_WORKSPACE/* | |
| echo "" | |
| echo "/home/runner usage:" | |
| du -sh /home/runner/* | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Install Python dependencies | |
| run: | | |
| uv venv --python=python${{ matrix.python-version }} | |
| source ./.venv/bin/activate | |
| uv sync --no-cache | |
| - name: Disk Usage - uv | |
| run: | | |
| echo "Disk usage summary:" | |
| df -h | |
| echo "" | |
| echo "Workspace usage:" | |
| du -sh $GITHUB_WORKSPACE/* | |
| echo "" | |
| echo "/home/runner usage:" | |
| du -sh /home/runner/* | |
| echo "" | |
| echo ".venv usage:" | |
| du -sh .venv | |
| echo "" | |
| echo ".venv/* usage:" | |
| du -sh .venv/lib/python${{ matrix.python-version }}/site-packages/* | sort -hr | head -20 | |
| - name: Add .venv to PATH | |
| run: | | |
| echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH | |
| - name: Display Python dependencies | |
| run: | | |
| uv pip list | |
| - name: Verify tox installed | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| tox -h | |
| - name: Copy .env file | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| cp ./tests/.env.tests .env | |
| docker compose config | |
| - name: Start Docker services | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| docker compose --profile marker up -d | |
| env: | |
| HOST_DATA_FOLDER: ${{ github.workspace }}/tests/data/single_synthetic_doc | |
| - name: Wait for services to be healthy | |
| run: | | |
| docker compose ps | |
| docker compose logs | |
| sleep 30 | |
| docker compose ps | |
| docker compose logs | |
| - name: Disk Usage - Docker services | |
| run: | | |
| echo "Disk usage summary:" | |
| df -h | |
| echo "" | |
| echo "Workspace usage:" | |
| du -sh $GITHUB_WORKSPACE/* | |
| echo "" | |
| echo "/home/runner usage:" | |
| du -sh /home/runner/* | |
| - name: Test with tox | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| echo "" | |
| echo "HOST_DATA_FOLDER: $HOST_DATA_FOLDER" | |
| tox -- \ | |
| tests/api/test_app.py::test_local_start_api_and_healthy \ | |
| tests/api/test_routers.py::test_router_marker \ | |
| tests/api/test_routers.py::test_inference_single_file_upload_marker \ | |
| tests/api/test_routers.py::test_inference_on_folder_marker | |
| - name: Tear down services | |
| working-directory: ${{ github.workspace }} | |
| if: always() | |
| run: | | |
| docker compose --profile marker down --rmi all --volumes --remove-orphans |