Repository navigation
fix(openai): align first-chunk fields and cover response combinations #2510
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: | |
| pull_request: | |
| branches: [main, master, "release/**"] | |
| push: | |
| branches: [main, master, "release/**"] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5 | |
| with: | |
| python-version-file: .python-version | |
| - name: Install dependencies | |
| run: uv sync --frozen --extra test | |
| - name: Run tests | |
| run: uv run pytest -xv -m "not slow and not performance" --cov=src --cov-report=xml --cov-report=html | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: | | |
| coverage.xml | |
| htmlcov/ | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5 | |
| with: | |
| python-version-file: .python-version | |
| - name: Build wheel | |
| run: uv build | |
| - name: Install from wheel and smoke test | |
| run: | | |
| uv venv /tmp/smoke-test | |
| uv pip install --python /tmp/smoke-test/bin/python dist/*.whl | |
| /tmp/smoke-test/bin/inference-endpoint --help | |
| audit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5 | |
| with: | |
| python-version-file: .python-version | |
| - name: Install dependencies | |
| run: uv sync --frozen --extra dev --extra test --extra performance | |
| - name: Audit dependencies for known vulnerabilities | |
| # PYSEC-2026-3740 (CVE-2026-81726): nltk path traversal in model-artifact | |
| # APIs (TransitionParser, AveragedPerceptron, PerceptronTagger, maxent). | |
| # Unreachable here: only sent_tokenize and rouge_score's Porter stemmer | |
| # are used. No fixed nltk release yet. | |
| # TODO: drop the ignore - https://github.com/mlcommons/endpoints/issues/520 | |
| run: uv run pip-audit --ignore-vuln PYSEC-2026-3740 | |
| bfcl-smoke: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5 | |
| with: | |
| python-version-file: .python-version | |
| # bfcl conflicts with dev/test/performance (see [tool.uv].conflicts), so it | |
| # is resolved in its own fork and installed standalone — the one config the | |
| # other jobs never exercise. | |
| - name: Install bfcl extra (isolated resolution fork) | |
| run: uv sync --frozen --extra bfcl | |
| - name: Smoke-check bfcl-eval import/resolution | |
| run: uv run --frozen --extra bfcl python scripts/bfcl_import_smoke.py | |
| schema-updated: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5 | |
| with: | |
| python-version-file: .python-version | |
| - name: Check for schema changes | |
| id: schema | |
| run: | | |
| CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- \ | |
| 'src/inference_endpoint/config/schema.py' \ | |
| 'src/inference_endpoint/endpoint_client/config.py' \ | |
| 'src/inference_endpoint/commands/benchmark/cli.py' \ | |
| 'scripts/regenerate_templates.py' \ | |
| 'src/inference_endpoint/config/templates/*.yaml') | |
| echo "changed=$([[ -n "$CHANGED" ]] && echo true || echo false)" >> "$GITHUB_OUTPUT" | |
| - name: Run schema fuzz tests | |
| if: steps.schema.outputs.changed == 'true' | |
| run: uv run --frozen --extra test pytest -xv -m schema_fuzz | |
| - name: Check YAML templates are up to date | |
| if: steps.schema.outputs.changed == 'true' | |
| run: uv run --frozen python scripts/regenerate_templates.py --check |