[router] fix router release workflow and add build test in PR (#12315)
This commit is contained in:
@@ -21,6 +21,55 @@ env:
|
||||
SCCACHE_GHA_ENABLED: "true"
|
||||
|
||||
jobs:
|
||||
maturin-build-test:
|
||||
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-ci')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
path: sglang-repo
|
||||
|
||||
- name: Move sgl-router folder to root
|
||||
run: |
|
||||
mv sglang-repo/sgl-router/* .
|
||||
rm -rf sglang-repo
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.13"
|
||||
|
||||
- name: Install protoc and dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y wget unzip gcc g++ perl make
|
||||
cd /tmp
|
||||
wget https://github.com/protocolbuffers/protobuf/releases/download/v32.0/protoc-32.0-linux-x86_64.zip
|
||||
sudo unzip protoc-32.0-linux-x86_64.zip -d /usr/local
|
||||
rm protoc-32.0-linux-x86_64.zip
|
||||
protoc --version
|
||||
|
||||
- name: Configure sccache
|
||||
uses: mozilla-actions/sccache-action@v0.0.9
|
||||
with:
|
||||
version: "v0.10.0"
|
||||
|
||||
- name: Test maturin build
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
args: --release --out dist
|
||||
rust-toolchain: stable
|
||||
sccache: true
|
||||
|
||||
- name: List built wheel
|
||||
run: ls -lh dist/
|
||||
|
||||
- name: Test wheel install
|
||||
run: |
|
||||
pip install dist/*.whl
|
||||
python -c "import sglang_router; print('Python package: OK')"
|
||||
python -c "from sglang_router.sglang_router_rs import Router; print('Rust extension: OK')"
|
||||
python -m sglang_router.launch_router --help > /dev/null && echo "Entry point: OK"
|
||||
unit-test-rust:
|
||||
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-ci')
|
||||
runs-on: ubuntu-latest
|
||||
@@ -116,8 +165,8 @@ jobs:
|
||||
source "$HOME/.cargo/env"
|
||||
export RUSTC_WRAPPER=sccache
|
||||
cd sgl-router
|
||||
pip install setuptools-rust wheel build
|
||||
python3 -m build
|
||||
pip install maturin
|
||||
maturin build --release --out dist
|
||||
pip install --force-reinstall dist/*.whl
|
||||
|
||||
|
||||
@@ -213,8 +262,8 @@ jobs:
|
||||
source "$HOME/.cargo/env"
|
||||
export RUSTC_WRAPPER=sccache
|
||||
cd sgl-router
|
||||
pip install setuptools-rust wheel build
|
||||
python3 -m build
|
||||
pip install maturin
|
||||
maturin build --release --out dist
|
||||
pip install --force-reinstall dist/*.whl
|
||||
|
||||
- name: Run Python E2E response API tests
|
||||
@@ -237,7 +286,7 @@ jobs:
|
||||
|
||||
|
||||
finish:
|
||||
needs: [unit-test-rust, pytest-rust, pytest-rust-2]
|
||||
needs: [maturin-build-test, unit-test-rust, pytest-rust, pytest-rust-2]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Finish
|
||||
|
||||
Reference in New Issue
Block a user