[router] enable sccache in ci and local build (#10099)

This commit is contained in:
Simo Lin
2025-09-12 12:43:48 -04:00
committed by GitHub
parent 4634fd5953
commit 8c86595c93
5 changed files with 194 additions and 29 deletions

View File

@@ -15,6 +15,10 @@ concurrency:
group: pr-test-rust-${{ github.ref }}
cancel-in-progress: true
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
jobs:
unit-test-rust:
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
@@ -27,10 +31,17 @@ jobs:
run: |
bash scripts/ci/ci_install_rust.sh
- name: Configure sccache
uses: mozilla-actions/sccache-action@v0.0.9
with:
version: "v0.10.0"
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: sgl-router
cache-all-crates: true
cache-on-failure: true
- name: Run lint
run: |
@@ -65,6 +76,11 @@ jobs:
# Run quick benchmarks to ensure they work using Python script
python3 scripts/run_benchmarks.py --quick
- name: Show sccache stats
if: always()
run: sccache --show-stats
e2e-python:
pytest-rust:
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
runs-on: BM.A10.4
@@ -77,6 +93,18 @@ jobs:
run: |
bash scripts/ci/ci_install_rust.sh
- name: Configure sccache
uses: mozilla-actions/sccache-action@v0.0.9
with:
version: "v0.10.0"
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: sgl-router
cache-all-crates: true
cache-on-failure: true
- name: Install SGLang dependencies
run: |
sudo bash scripts/ci/ci_install_dependency.sh
@@ -84,6 +112,7 @@ jobs:
- name: Build python binding
run: |
source "$HOME/.cargo/env"
export RUSTC_WRAPPER=sccache
cd sgl-router
pip install setuptools-rust wheel build
python3 -m build