1. Resources
  2. /
  3. Blog
  4. /
  5. Announcing Build Matrix

Announcing Build Matrix

1 minute read

We’re excited to announce the Build Matrix, a new way of creating multiple jobs from a single, multi-variant step definition. For example, rather than creating three separate pipelines for macOS, Linux and Windows builds, you could use the matrix to create all of these variants from within a single step.

Build Matrix expands a single step into multiple steps by replacing the {{matrix}} variable in the label and command attributes of a command step with each value provided in the matrix array. You can interpolate the matrix values into command steps (including step labels) and into environment variables.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
steps:
 - name: ":{{matrix.os}}: {{matrix.arch}}"
   command: ".buildkite/steps/build-binary.sh {{matrix.os}} {{matrix.arch}}"
   matrix:
     setup:
       os:
         - darwin
         - freebsd
         - linux
         - openbsd
         - windows
       arch:
         - "386"
         - amd64
         - arm64

For customers dealing with complex, repetitive pipelines, this update will allow them to avoid boilerplate and duplication, and reduce the time spent managing multiple separate pipelines and builds. As an example, see this recent PR against our own agent repository, which reduced a 402-line pipeline down to 160 lines 📉.

Once you’re up to speed with the basic, there are also a range of power user features available ⚡️:

  • For more complex builds you can add multiple dimensions to matrix.setup instead of the matrix array.
  • You can add combos by using the adjustments key to define all of the elements in the matrix.
  • You can also group matrix jobs to make it easier to make sense of what’s happening in your builds

The Build Matrix is available today to every Buildkite customer — for more information check out the documentation 📚.


Related posts

Start turning complexity into an advantage

Create an account to get started with a 30-day free trial. No credit card required.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Pipeline templates
  3. Public pipelines
  4. Test Engine
  5. Package Registries
  6. Mobile Delivery Cloud
  7. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Webinars
  5. Plugins
  6. Case studies
  7. Events

Company

  1. About
  2. Careers
  3. Press
  4. Brand assets
  5. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML
  3. Testing at scale
  4. Monorepo delivery

Support

  1. System status
  2. Forum