CICD-386 · Bazel build
Encyclopedia · Monorepo and large-scale build engineering · All snippets
Previous · CICD-385 · Next · CICD-387
1. Where it fits
- Placement CI run step.
- Prerequisites trusted checkout with the base ref fetched and pinned package manager or build tool.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
bazel build //services/api:release
bazel test //services/api/... --test_output=errors3. How it works
Bazel computes the requested dependency graph and builds or tests targets with the selected toolchain and execution options. The shell predicate makes the expected state explicit and returns a nonzero status when it is not satisfied.
4. Verify the result
Use a repository-pinned Bazel version and explicit target graph.
Validation syntax-validated (Bash parse). Status definitions.