|
| 1 | +name: API Conformance Tests |
| 2 | + |
| 3 | +run-name: Run the API Conformance test suite on the changes. |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [ main ] |
| 8 | + pull_request: |
| 9 | + branches: [ main ] |
| 10 | + types: [opened, synchronize, reopened] |
| 11 | + paths: |
| 12 | + - 'llama_stack/**' |
| 13 | + - '!llama_stack/ui/**' |
| 14 | + - 'tests/**' |
| 15 | + - 'uv.lock' |
| 16 | + - 'pyproject.toml' |
| 17 | + - '.github/workflows/conformance.yml' # This workflow |
| 18 | + - '.github/actions/setup-ollama/action.yml' |
| 19 | + - '.github/actions/setup-test-environment/action.yml' |
| 20 | + - '.github/actions/run-and-record-tests/action.yml' |
| 21 | + schedule: |
| 22 | + # If changing the cron schedule, update the provider in the test-matrix job |
| 23 | + - cron: '0 0 * * *' # (test latest client) Daily at 12 AM UTC |
| 24 | + - cron: '1 0 * * 0' # (test vllm) Weekly on Sunday at 1 AM UTC |
| 25 | + |
| 26 | +concurrency: |
| 27 | + # Skip concurrency for pushes to main - each commit should be tested independently |
| 28 | + group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }} |
| 29 | + cancel-in-progress: true |
| 30 | + |
| 31 | +jobs: |
| 32 | + check-schema-compatibility: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - name: Checkout PR Code |
| 36 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0 |
| 37 | + |
| 38 | + - name: Checkout Base Branch |
| 39 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # 5.0.0 |
| 40 | + with: |
| 41 | + ref: ${{ github.event.pull_request.base.ref }} |
| 42 | + path: 'base' |
| 43 | + |
| 44 | + # does this include yq? |
| 45 | + - name: Install dependencies |
| 46 | + uses: ./.github/actions/setup-runner |
| 47 | + |
| 48 | + - name: Filter Schemas |
| 49 | + run: | |
| 50 | + # Define the filter to match all paths that start with the specified prefixes. |
| 51 | + FILTER_CONDITION=' |
| 52 | + .paths |= with_entries(select( |
| 53 | + (.key | startswith("/v1/inference")) or |
| 54 | + (.key | startswith("/v1/vector-io")) or |
| 55 | + (.key | startswith("/v1/vector-dbs")) or |
| 56 | + (.key | startswith("/v1/openai/v1/responses")) or |
| 57 | + (.key | startswith("/v1/openai/chat")) |
| 58 | + )) |
| 59 | + ' |
| 60 | +
|
| 61 | + # Filter the base and revision schema files |
| 62 | + yq eval "$FILTER_CONDITION" base/docs/_static/llama-stack-spec.yaml > base-filtered.yaml |
| 63 | + yq eval "$FILTER_CONDITION" docs/_static/llama-stack-spec.yaml > revision-filtered.yaml |
| 64 | +
|
| 65 | + - name: Run OpenAPI Diff on Filtered Schemas |
| 66 | + uses: OpenAPITools/openapi-diff-action@c71c94cb937760c067818cdc5e14b3a1115fb840 # v2.1.2 |
| 67 | + with: |
| 68 | + base: 'base-filtered.yaml' |
| 69 | + revision: 'revision-filtered.yaml' |
| 70 | + fail-on-incompatible: true |
0 commit comments