Examples

Build Matrix

If any step in the in_parallel fails, the build will fail, making it useful for build matrices:

plan:
- get: some-repo
- in_parallel:
  - task: unit-windows
    file: some-repo/ci/windows.yml
  - task: unit-linux
    file: some-repo/ci/linux.yml
  - task: unit-darwin
    file: some-repo/ci/darwin.yml

Parallel Fetching

The in_parallel step is useful for speeding up builds, and is often used to fetch all dependent resources together:

plan:
- in_parallel:
  - get: component-a
  - get: component-b
  - get: integration-suite
- task: integration
  file: integration-suite/task.yml

Limited Parallelism

Using limit is useful for performing parallel execution of a growing number of tasks without overloading your workers. In the example below, two tasks will be run in parallel and in order until all steps have been executed:

plan:
- get: some-repo
- in_parallel:
    limit: 2
    fail_fast: false
    steps:
      - task: unit-windows
        file: some-repo/ci/windows.yml
      - task: unit-linux
        file: some-repo/ci/linux.yml
      - task: unit-darwin
        file: some-repo/ci/darwin.yml

1.7.1.5 in_parallel step

in_parallel: ([step] | config)

Performs the given steps in parallel.

If any sub-steps (or task) in a parallel result in a failure or error, the parallel step as a whole is considered to have failed or errored.

Two forms of configuration are supported. The simplest form is a simple array of other steps, like so:

in_parallel:
- get: a
- get: b

This is shorthand for the following configuration:

in_parallel:
  steps:
  - get: a
  - get: b

Further configuration can be specified as follows:

steps: [step]

Optional. The steps to perform in parallel.

limit: integer

Optional. Default is no limit. A sempahore which limits the parallelism when executing the steps in a in_parallel step. When set, the number of running steps will not exceed the limit.

When not specified in_parallel will execute all steps immediately, making the default behavior identical to aggregate.

fail_fast: bool

Optional. Default is false. When enabled the parallel step will fail fast by returning as soon as any sub-step fails. This means that running steps will be interrupted and pending steps will no longer be scheduled.