Repository navigation
131 lines (107 loc) · 4.48 KB
/
Copy pathtest.yml
File metadata and controls
131 lines (107 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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