WorkflowsConfiguration
The root Workflows configuration.
Table of contents
Properties overview
Properties
bazel
• bazel: BazelConfiguration
Global Bazel configuration. These properties apply to each Bazel based task. Can be overridden at the task or workspace level as required.
Note that if Bazel rc files are listed here, they are applied to each workspace with a relative path, therefore they must be available in each workspace referenced.
env
• env: Map
<string
, string
>
A set of environment variables for each task. Can be overridden at the task level.
hooks
• Optional
hooks: TaskHook
List of hooks that apply to all primary tasks by default. This list is combined with a list provided at the workspace and task level. Hooks are run sequentially, starting with hooks at the root level.
Hooks are commands conditionally run at various stages within a task. For example, they can be used for setting up test databases before a test task runs, and then performing cleanup after.
If an id
is supplied for a hook, you can override it at the workspace and task level.
A hook definition can take a when
condition to allow for applying hooks to a particular task type, or the use of other conditional expressions.
If you supply a custom when
condition on a hook at the root level, the default behavior of running only on primary task types is dropped, and must
be supplied on the custom condition.
For example, to run a hook on all primary tasks on the main
branch:
hooks:
- type: before_task
command: docker login
when:
and:
- task:
primary: true
- branches
- main
To avoid repeating hooks, use YAML anchors (&
) and aliases (*
), for example:
tasks:
- test:
targets:
- ...
hooks: &hooks
- type: before_task
...
- warming:
hooks: *hooks
If you don't supply a custom condition, the hook runs on all primary task types. A primary task is one of the following types:
- build
- buildifier
- configure
- delivery
- format
- gazelle
- lint
- test
- warming
See
ConditionExpression for more information on conditions.
Inherited from
BazelTaskConfiguration.hooks
notifications
• Optional
notifications: NotificationConfiguration
The notifications issued on build pass/fail events.
telemetry
• telemetry: false
| TelemetryConfiguration
Connection properties for the telemetry system.
If set to false
, build telemetry is disabled.
Workflows 5.10 and older named this property observability
.
queue
• queue: string
= 'aspect-default'
The queue / runner pool that each task should run on.
tasks
• tasks: ReadonlyMap
<string
, TaskConfiguration
>
Map of tasks that should be enabled for this workspace. By default, the tasks inherited from the root workspace, so it is not required to list them twice. Tasks listed here have their configuration merged with the root.
warming
• Optional
warming: warming
Enables warming for all the workspaces.
Deprecated
Set options directly on the WarmingTaskConfiguration in the tasks map.
workspaces
• workspaces: Map
<string
, WorkspaceConfiguration
>
Map of nested workspaces to create additional tasks for.
For example, if a nested Bazel workspace exists at examples/service
within the repository,
the following configuration could be used to create additional tasks.
Example
workspaces:
- examples/service
tasks:
- test:
This property accepts both a list of workspace paths, or a map where the key is the workspace path, and the value is additional workspace options via WorkspaceConfiguration.