forked from LMCache/LMCache
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (77 loc) · 2.99 KB
/
build_cli_artifacts.yml
File metadata and controls
95 lines (77 loc) · 2.99 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
name: Build CLI Artifacts
# Reusable workflow that builds the pure-Python lmcache-cli wheel (no CUDA).
# Uploaded as the `release-cli-artifacts` GHA artifact.
on:
workflow_call:
pull_request:
branches:
- dev
- "release-**"
paths:
- 'lmcache/cli/**.py'
- 'pyproject_cli.toml'
- 'requirements/cli.txt'
- '.github/workflows/build_cli_artifacts.yml'
env:
LC_ALL: en_US.UTF-8
defaults:
run:
shell: bash
# Cancel stale runs per ref; PR and dev-push refs differ, so workflow_call is unaffected.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-cli-artifacts:
name: Build CLI artifacts
runs-on: ubuntu-latest
steps:
- name: "Harden Runner"
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
disable-sudo-and-containers: false
egress-policy: audit
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Remove non-release tags
run: git tag -l | grep -vE '^v[0-9]+\.[0-9]+\.[0-9]+$' | xargs -r git tag -d
- name: Setup Python 3.13
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: "3.13"
- name: Install build tooling
run: |
python -m pip install --upgrade pip
pip install build
- name: Clean up release artifacts
run: |
rm -rf dist/
- name: Build lmcache-cli wheel (pure Python, no native extensions)
run: |
cp pyproject_cli.toml pyproject.toml
NO_NATIVE_EXT=1 python -m build --wheel
- name: Smoke-test CLI wheel (no torch)
run: |
pip install dist/lmcache_cli-*.whl
# CLI wheel must be pure-Python.
if unzip -l dist/lmcache_cli-*.whl | grep -E '\.(so|pyd)$'; then
echo "::error::CLI wheel contains compiled extensions; should be pure-Python"
exit 1
fi
python -c "import lmcache"
lmcache --help
# Slim-supported subcommands only (server is full-only).
for cmd in mock kvcache describe ping query bench tool trace; do
echo "::group::lmcache $cmd --help"
lmcache "$cmd" --help
echo "::endgroup::"
done
- name: Upload CLI release artifacts to GHA
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: release-cli-artifacts
path: dist/