We’ve seen some demand for the ability to express “matrix” builds in CircleCI config, and we’re working on implementing it. We’d like to share our latest design to get a sense for how it fits into your use cases.
Our implementation of this feature builds on top of parameterized jobs. A “matrix” here is essentially syntactic sugar for invoking a certain job many times with different combinations of parameters.
jobs:
test:
parameters:
os:
type: string
node-version:
type: string
steps:
- ...
workflows:
build:
jobs:
- test:
matrix:
parameters:
os:
- linux
- macos
node-version:
- 6
- 8
- 10
This would turn into a workflow with six jobs.
There are several other facets of this syntax that are better explained in our more comprehensive config example: https://github.com/CircleCI-Public/pipeline-preview-docs/blob/master/docs/concepts/matrices.yml
Would this feature help you write maintainable configs? What alterations to the syntax would make it more intuitive / useful?
Thanks!