Moondream2 for inference_exp #333
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: INTEGRATION TESTS - inference_experimental (CPU) | |
permissions: | |
contents: read | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
workflow_dispatch: | |
inputs: | |
extras: | |
description: 'Extras to test. Available options: onnx_extras. Leave empty to run all.' | |
required: false | |
default: '' | |
type: choice | |
options: | |
- '' | |
- onnx_extras | |
python_version: | |
description: 'Python version to test. Available options: 3.10, 3.11, 3.12. Leave empty to run all.' | |
required: false | |
default: '' | |
type: choice | |
options: | |
- '' | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
jobs: | |
integration-tests-inference-experimental-cpu: | |
name: ${{ matrix.extras.marker }}:${{ matrix.python-version }} | |
runs-on: | |
labels: depot-ubuntu-22.04-4 | |
group: public-depot | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
extras: | |
- { install: "onnx-cpu", marker: "onnx_extras" } | |
steps: | |
- name: 🛎️ Checkout | |
if: ${{ (github.event.inputs.extras == '' || github.event.inputs.extras == matrix.extras.marker) && (github.event.inputs.python_version == '' || github.event.inputs.python_version == matrix.python-version) }} | |
uses: actions/checkout@v4 | |
- name: 📦 Cache Python packages | |
if: ${{ (github.event.inputs.extras == '' || github.event.inputs.extras == matrix.extras.marker) && (github.event.inputs.python_version == '' || github.event.inputs.python_version == matrix.python-version) }} | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/uv | |
key: ${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles('inference_experimental/pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-uv-${{ matrix.python-version }}- | |
- name: 🐍 Set up Python ${{ matrix.python-version }} | |
if: ${{ (github.event.inputs.extras == '' || github.event.inputs.extras == matrix.extras.marker) && (github.event.inputs.python_version == '' || github.event.inputs.python_version == matrix.python-version) }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
check-latest: true | |
- name: 📦 Install base dependencies as well as `${{ matrix.extras.install }}` dependencies | |
if: ${{ (github.event.inputs.extras == '' || github.event.inputs.extras == matrix.extras.marker) && (github.event.inputs.python_version == '' || github.event.inputs.python_version == matrix.python-version) }} | |
working-directory: inference_experimental | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install uv | |
python -m uv venv | |
python -m uv pip install -e .[test,${{ matrix.extras.install }}] --python .venv | |
- name: 🧪 Run tests marked `${{ matrix.extras.marker }}` | |
if: ${{ (github.event.inputs.extras == '' || github.event.inputs.extras == matrix.extras.marker) && (github.event.inputs.python_version == '' || github.event.inputs.python_version == matrix.python-version) }} | |
working-directory: inference_experimental | |
timeout-minutes: 30 | |
run: | | |
source .venv/bin/activate | |
python -m pytest -n auto -m ${{ matrix.extras.marker }} tests/integration_tests |