[Feat]: Signal-Decision Driven Semantic Routing with Dynamic Plugin Architecture #1772
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test And Build | |
| on: | |
| schedule: | |
| # Run nightly at 2:00 AM UTC | |
| - cron: "0 2 * * *" | |
| workflow_dispatch: # Allow manual triggering | |
| pull_request: # Run on all pull requests | |
| jobs: | |
| test-and-build: | |
| if: github.repository == 'vllm-project/semantic-router' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: 1.90 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.24" | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| make \ | |
| build-essential \ | |
| pkg-config | |
| curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.5.0 | |
| - name: Cache Rust dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| candle-binding/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Cache Go dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Cache Models | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| models/ | |
| key: ${{ runner.os }}-models-v1-${{ hashFiles('tools/make/models.mk') }} | |
| restore-keys: | | |
| ${{ runner.os }}-models-v1- | |
| continue-on-error: true # Don't fail the job if caching fails | |
| - name: Check go mod tidy | |
| run: make check-go-mod-tidy | |
| - name: Build Rust library (CPU-only, no CUDA) | |
| run: make rust-ci | |
| - name: Install HuggingFace CLI | |
| run: | | |
| pip install -U "huggingface_hub[cli]" hf_transfer | |
| - name: Download models (minimal on PRs) | |
| env: | |
| CI_MINIMAL_MODELS: ${{ github.event_name == 'pull_request' }} | |
| HF_HUB_ENABLE_HF_TRANSFER: 1 | |
| HF_HUB_DISABLE_TELEMETRY: 1 | |
| run: make download-models | |
| - name: Start Milvus service | |
| run: | | |
| echo "Starting Milvus vector database..." | |
| docker run -d \ | |
| --name milvus-semantic-cache \ | |
| --security-opt seccomp:unconfined \ | |
| -e ETCD_USE_EMBED=true \ | |
| -e ETCD_DATA_DIR=/var/lib/milvus/etcd \ | |
| -e ETCD_CONFIG_PATH=/milvus/configs/advanced/etcd.yaml \ | |
| -e COMMON_STORAGETYPE=local \ | |
| -e CLUSTER_ENABLED=false \ | |
| -p 19530:19530 \ | |
| -p 9091:9091 \ | |
| milvusdb/milvus:v2.3.3 \ | |
| milvus run standalone | |
| echo "Waiting for Milvus to be ready..." | |
| sleep 20 | |
| # Verify Milvus is responsive | |
| timeout 30 bash -c 'until docker logs milvus-semantic-cache 2>&1 | grep -q "Proxy successfully started"; do sleep 2; done' || true | |
| echo "Milvus is ready at localhost:19530" | |
| docker ps --filter "name=milvus-semantic-cache" | |
| - name: Run semantic router tests | |
| run: make test | |
| env: | |
| CI: true | |
| CI_MINIMAL_MODELS: ${{ github.event_name == 'pull_request' }} | |
| CGO_ENABLED: 1 | |
| LD_LIBRARY_PATH: ${{ github.workspace }}/candle-binding/target/release | |
| MILVUS_URI: localhost:19530 | |
| SKIP_MILVUS_TESTS: false | |
| - name: Stop Milvus service | |
| if: always() | |
| run: | | |
| echo "Stopping Milvus container..." | |
| docker stop milvus-semantic-cache || true | |
| docker rm milvus-semantic-cache || true | |
| echo "Milvus container cleaned up" | |
| - name: Upload test artifacts on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-logs | |
| path: | | |
| **/*.log | |
| **/test-output.* | |
| retention-days: 7 | |
| - name: Notify on failure | |
| if: failure() | |
| run: | | |
| echo "::error::Test and build failed. Check the workflow run for details." | |
| # Trigger Docker publishing on successful nightly runs | |
| publish-docker: | |
| needs: test-and-build | |
| if: github.repository == 'vllm-project/semantic-router' && success() && github.event_name == 'schedule' | |
| uses: ./.github/workflows/docker-publish.yml | |
| with: | |
| tag_suffix: nightly-$(date +'%Y%m%d') | |
| is_nightly: true | |
| secrets: inherit |