|
53 | 53 | python -m pip install pip==26.0.1 |
54 | 54 | pip install -e ".[dev,test,performance]" |
55 | 55 | pip-audit |
| 56 | +
|
| 57 | + schema-updated: |
| 58 | + runs-on: ubuntu-latest |
| 59 | + if: github.event_name == 'pull_request' |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 62 | + with: |
| 63 | + fetch-depth: 0 |
| 64 | + |
| 65 | + - name: Check for schema changes |
| 66 | + id: schema |
| 67 | + run: | |
| 68 | + CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- \ |
| 69 | + 'src/inference_endpoint/config/schema.py' \ |
| 70 | + 'src/inference_endpoint/endpoint_client/config.py' \ |
| 71 | + 'src/inference_endpoint/commands/benchmark/cli.py' \ |
| 72 | + 'scripts/regenerate_templates.py' \ |
| 73 | + 'src/inference_endpoint/config/templates/*.yaml') |
| 74 | + echo "changed=$([[ -n "$CHANGED" ]] && echo true || echo false)" >> "$GITHUB_OUTPUT" |
| 75 | +
|
| 76 | + - name: Set up Python 3.12 |
| 77 | + if: steps.schema.outputs.changed == 'true' |
| 78 | + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 79 | + with: |
| 80 | + python-version: "3.12" |
| 81 | + |
| 82 | + - name: Install dependencies |
| 83 | + if: steps.schema.outputs.changed == 'true' |
| 84 | + run: | |
| 85 | + python -m pip install --upgrade pip |
| 86 | + pip install -e ".[test]" |
| 87 | +
|
| 88 | + - name: Run schema fuzz tests |
| 89 | + if: steps.schema.outputs.changed == 'true' |
| 90 | + run: | |
| 91 | + pytest -xv -m schema_fuzz |
| 92 | +
|
| 93 | + - name: Check YAML templates are up to date |
| 94 | + if: steps.schema.outputs.changed == 'true' |
| 95 | + run: | |
| 96 | + python scripts/regenerate_templates.py --check |
0 commit comments