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.
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 ⚡️:
matrix.setup
instead of the matrix array.The Build Matrix is available today to every Buildkite customer — for more information check out the documentation 📚.
Buildkite is the fastest, most secure way to test and deploy code at any scale.
Our self-hosted agents work in your environment with any source code tool, platform and language including but not limited to Ruby, Xcode, Go, Node, Python, Java, Haskell, .NET or pre-release tools.