Skip to main content
aspect build and aspect test run Bazel builds and tests from your CI pipeline. Environment-specific flags (BES endpoint, build metadata, runner optimizations) are injected by the BazelDefaults feature. GitHub status checks are posted by the GithubStatusChecks feature. Artifact uploads are handled by the ArtifactUpload feature.
Task-level retry, timeout, and conditional execution are now handled by your CI platform rather than the task runner. Bazel’s internal retry for transient errors (e.g. BLAZE_INTERNAL_ERROR, LOCAL_ENVIRONMENTAL_ERROR) is still built into the CLI.

What changed

Configuration

Many of the settings below can be applied in either of two ways:
  • CLI flag — pass the flag at invocation time (e.g. aspect build --bazel-flag=--config=remote //...). Good for overrides on individual task invocations, or experimenting with a setting before committing it.
  • .aspect/config.axl — declare it once in your repo’s AXL config so every aspect build / aspect test invocation picks it up. Good for settings that should apply to all invocations of a task type. AXL also lets you compute values programmatically (e.g. branching on CI host or environment), which is more expressive than shell logic wrapped around CLI flags.
Pick whichever fits — you only need one. Where both work, the sections below show them side-by-side under After.

Targets

Before.aspect/workflows/config.yaml:
After — positional CLI args or config.axl:
The default (no arguments) is ... — expands to all rule targets in the package at and beneath your current directory.

Bazel flags

Before.aspect/workflows/config.yaml:
After — CLI flag or config.axl:

Test tag filters

Before.aspect/workflows/config.yaml:
After — CLI flag or config.axl:

Code coverage

Before.aspect/workflows/config.yaml:
After — CLI flag or config.axl:

Test log upload

Before.aspect/workflows/config.yaml:
After — CLI flag or config.axl:
Upload strategies: none (default), failed, executed, all. Test log upload is one knob of the broader Artifact upload feature — see that section for the full list of artifact kinds and authentication requirements.

GitHub status checks

The legacy YAML-configured tasks posted build and test results to a PR comment via the Aspect Workflows GitHub App (also known as Marvin) — there was no per-task GitHub status check. The new Aspect CLI posts a GitHub status check for each aspect build / aspect test invocation via the GithubStatusChecks feature. The feature is enabled by default but only posts checks when the CLI is authenticated — without ASPECT_API_TOKEN set on the runner and the Aspect Workflows GitHub App installed, nothing reaches GitHub. GithubStatusChecks:
  • Creates a check run on the commit as soon as the task starts
  • Updates it with live build progress (target counts, failures) during the build
  • Completes it with a pass/fail conclusion and a build summary including artifact download links
Set --task:name explicitly on any invocation that uses GithubStatusChecks or ArtifactUpload. Status check names and uploaded artifact names are derived from the task name, so a stable, distinct value per invocation makes results identifiable (e.g. build, test). If you omit --task:name, the CLI generates a random one per run and your status checks and artifacts will end up with unpredictable, non-reusable names.

Authentication

GithubStatusChecks needs:
  • ASPECT_API_TOKEN exposed to the runner.
  • The Aspect Workflows GitHub App (also known as Marvin) installed on the GitHub org/repository and linked to your Aspect account, so the CLI can use the App to post the check.
See the GitHub App page for installing and linking the app, and Authenticating the Aspect CLI for generating the API token. The most common first-use scenario is a runner without ASPECT_API_TOKEN set. In that case the CLI logs one GitHub status check: authentication failed for <owner>/<repo> — <reason> line per task and the build continues normally. The reason explains what’s missing and includes a link to the setup guide, for example:
If checks still don’t appear after authentication is in place, search the build log for GitHub status check: to see what was reported. GithubStatusChecks failures are isolated from the build/test task: transport errors (DNS, TLS, connection refused), API errors (e.g. GitHub 5xx), and other failures inside the feature are caught and logged but never fail the parent aspect build / aspect test invocation.

Artifact upload

The ArtifactUpload feature uploads build artifacts to the CI platform. All upload kinds are opt-in (off by default) because uploaded artifacts are accessible to anyone with repo read access.
On public repositories, uploaded artifacts are downloadable by anyone on the internet. Treat every upload kind as public-by-default and double-check the risk column below before enabling anything.
Build logs (upload_build_logs, values none / failed, default none) upload the full stdout and stderr of every failed build action to CI artifacts — the non-test counterpart to upload_test_logs. Each log has a provenance header (# target, # action, # primary output, # stream) and a target-based archive path (e.g. foo/bar/baz/Genrule.stderr.log). When enabled, GitHub / GitLab status checks surface a Build logs link alongside the existing Test logs link. Enable permanently in config.axl:
ArtifactUpload does not use the Aspect Workflows GitHub App or ASPECT_API_TOKEN. It uploads to your CI platform’s native artifact storage using the runner’s own credentials: permissions: id-token: write on GitHub Actions, the Buildkite agent token, CI_JOB_TOKEN on GitLab, the CircleCI runner token. Make sure those credentials are present in the job environment. Supported platforms: Buildkite, CircleCI, GitHub Actions, GitLab.

CI integration examples