Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

ci: build the benchmark environment outside the CodSpeed runner (#38426)

devin-ai-integration[bot]194a3cc202dd
diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml
index a69e50b5753..7e013b7bb0b 100644
--- a/.github/workflows/codspeed.yml
+++ b/.github/workflows/codspeed.yml
@@ -12,6 +12,7 @@ on:
- "uv.lock"
- ".github/workflows/codspeed.yml"
- ".github/actions/setup-uv-with-retries/**"
+ - ".github/actions/cache-cargo-build/**"
pull_request:
branches:
- main
@@ -23,6 +24,7 @@ on:
- "uv.lock"
- ".github/workflows/codspeed.yml"
- ".github/actions/setup-uv-with-retries/**"
+ - ".github/actions/cache-cargo-build/**"
# Allow CodSpeed to trigger backtest performance analysis
# in order to generate initial data
workflow_dispatch:
@@ -55,6 +57,26 @@ jobs:
with:
version: "0.10.9"
+ - name: Cache the Rust build
+ uses: ./.github/actions/cache-cargo-build
+
+ # Build the wheel and resolve every dependency outside the CodSpeed
+ # runner: the same maturin build took 42 minutes inside `codspeed run`
+ # versus under 3 minutes as a plain step (LIT-6183)
+ - name: Build environment
+ run: >
+ env PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ uv run --frozen --no-default-groups
+ --with pytest==8.3.5
+ --with pytest-codspeed==4.3.0
+ --with "mcp>=1.26.0,<2.0"
+ --with "a2a-sdk>=1.1.0,<2.0"
+ pytest
+ -p pytest_codspeed.plugin
+ tests/benchmarks/
+ --codspeed
+ --collect-only -q
+
- name: Run benchmarks
uses: CodSpeedHQ/action@1c8ae4843586d3ba879736b7f6b7b0c990757fab # v4.12.1
with: