- All playbooks
- Unnecessary work
- Build only what the test or analysis consumes
Build only what the test or analysis consumes
Declare the build dependencies of each validation lane so unrelated targets do not join its critical path.
How companies used this technique
Read what each company changed and follow the original sources.
Build only what the analysis consumes
Stripe iOS stopped packaging XCFrameworks for the API check, which compares arm64 Swift interfaces only. Dead-code scanning builds the SDK frameworks directly and hands the fresh index to Periphery, after verifying the expected SDK roots. Stripe Android’s Financial Connections end-to-end job builds only the release variant it tests.
- Use it when
- A scan builds artifacts, architectures or test bundles that it never analyzes.
- Before applying it
- The build the analysis reads stays. Keep all analyzed symbols, required architectures, compiler settings and index completeness, and rebuild when the scheme no longer matches what the scan expects.
Build only the services each test consumes
SubmitQueue stopped building every Linux service before integration and end-to-end tests. Each test declares the cross-compiled binaries, Dockerfiles and configurations it consumes, and a minimal Docker context is staged from those inputs. OPT13 is adapted: the build stays, scoped to declared target dependencies.
The author reports all nine Docker suites and 79 unit tests passing locally, plus cached test results on a second run. Source
- Use it when
- A test target invokes a broad preparatory build even though it exercises only a subset of services.
- Before applying it
- Declare every runtime input and keep the compile-only gate. Image tags need a hash of the declared contents (the follow-up below), and test-result reuse depends on hermetic inputs and environment.
Build test dependencies in the test lane
SubmitQueue added --build_tests_only to its Bazel unit-test command and kept bazel build //... in a separate required job, so the test lane builds only the test dependency closure.
The merged Makefile narrows the unit-test build scope, and the separate build job keeps compile-only validation. Source
- Use it when
- A broad test command also builds non-test targets that another required job already compiles.
- Before applying it
- Check the build tool's exact target-selection rules, keep every discovered test, and keep compile-only targets in a required job.
Company Playbooks
- Read Anthropic’s playbookRun only affected tests
- Read DoorDash’s playbookRun build and test in parallel, sharded across CI agents
- Read Linear’s playbookBenchmark the same job on faster hardware
- Read Mastra’s playbookStarSling runners for the slowest test workflow
- Read OpenAI’s playbookRank CI fixes by the minutes they save
- Read Ramp’s playbookMove a CPU-bound test suite to a faster CPU
- Read Shopify’s playbookLet an agent iterate against one CI metric
- Read Spotify’s playbookBuild arm64 on native arm64 runners
- Read Stripe’s playbookRun only the tests a change can reach
- Read Uber’s playbookBuild the merge-queue speculations most likely to be needed