ci: build the CI test wheel with a fast cargo profile

The release profile (lto=thin, codegen-units=1) is great for the shipped wheel
but slow to compile — it was the build-wheel long pole (~3m38s) gating the test
shards. Add [profile.ci] (no LTO, codegen-units=256, opt-level=1) and build the
CI wheel with --profile ci. Does not affect --release / shipped wheels.
This commit is contained in:
Tejas Chopra 2026-06-04 11:38:30 -07:00
parent 9a16a59df4
commit a08a0befa7
2 changed files with 17 additions and 2 deletions

View file

@ -62,10 +62,12 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
workspaces: ". -> target"
- name: Build wheel once (maturin)
- name: Build wheel once (maturin, fast CI profile)
run: |
python -m pip install --upgrade pip maturin
maturin build --release --out dist --interpreter "python${PY_VERSION}"
# `--profile ci`: no LTO + parallel codegen-units → much faster compile
# than `--release` (lto + codegen-units=1). Tests don't need the optimized ext.
maturin build --profile ci --out dist --interpreter "python${PY_VERSION}"
- uses: actions/upload-artifact@v4
with:
name: headroom-wheel

View file

@ -106,3 +106,16 @@ gcp_auth = "0.12"
strip = "symbols"
lto = "thin"
codegen-units = 1
# Fast-to-compile profile for CI test wheels. The shipped wheel uses
# `release` (lto + codegen-units=1) for runtime/size; CI only needs a working
# extension, so trade runtime perf for ~parallel, lto-free compilation. Used
# via `maturin build --profile ci`. Does NOT affect `--release` builds.
[profile.ci]
inherits = "release"
lto = false
codegen-units = 256
opt-level = 1
strip = "none"
debug = false
incremental = false