What does `jobs.<id>.strategy.matrix` allow as values: only scalars?
IntermediateConceptJobs, Steps, Matrix & Concurrency
Answer
Values can be scalars, objects or arrays. Objects make readable matrices:
matrix:
target:
- { name: api, path: services/api, dockerfile: Dockerfile }
- { name: web, path: apps/web, dockerfile: Dockerfile.web }
steps:
- run: docker build -f ${{ matrix.target.path }}/${{ matrix.target.dockerfile }} ${{ matrix.target.path }}
The whole matrix can also be one fromJSON expression, as long as it evaluates to an object or the variable to an array.
More on Jobs, Steps, Matrix & Concurrency
How does `needs` work, and what happens to a job whose dependency failed or was skipped?BeginnerWhat is the implicit `success()` in a job `if`, and why is `always()` usually the wrong fix?IntermediateWhat values can `needs.<job>.result` take?BeginnerHow does a matrix expand, and how are job names generated?BeginnerHow do `include` and `exclude` work in a matrix?IntermediateWhat do `fail-fast` and `max-parallel` do?Beginner