Matrix in Workflows level
T
Takayuki Ito
The current matrix feature archives to pass multiple parameters to jobs and run jobs with different arguments.> https://circleci.com/docs/2.0/configuration-reference/#matrix-requires-version-21
To add the matrix feature in workflow level, it reduces more complex configuration. Especially, if there are some jobs in a workflow, currently it needs to set matrix feature in each job.
For example, the following setting creates 1 workflow with 16 jobs. The matrix setting is duplicated, and also the test job requires the build job, it means the test jobs need to wait for all the build jobs to finish.
workflows:
version: 2
build:
jobs: - build: matrix: parameters: os: ["latest-beta", "latest-release"] node-version: ["10.9.0", "11.9.0", "12.9.1", "13.9.0"] - test: requires: - build matrix: parameters: os: ["latest-beta", "latest-release"] node-version: ["10.9.0", "11.9.0", "12.9.1", "13.9.0"]↓ compileworkflows: version: 2 workflow: jobs: - build-latest-beta-10.9.0: os: latest-beta node-version: 10.9.0 - build-latest-beta-11.9.0: os: latest-beta node-version: 11.9.0 - build-latest-beta-12.9.1: os: latest-beta node-version: 12.9.1 - build-latest-beta-13.9.0: os: latest-beta node-version: 13.9.0 - test-latest-beta-10.9.0: os: latest-beta node-version: 10.9.0 requires: - build-latest-beta-10.9.0 - build-latest-beta-11.9.0 - build-latest-beta-13.9.0 - build-latest-beta-11.9.0 - test-latest-beta-11.9.0: os: latest-beta node-version: 11.9.0 requires: - build-latest-beta-10.9.0 - build-latest-beta-11.9.0 - build-latest-beta-13.9.0 - build-latest-beta-11.9.0 - test-latest-beta-12.9.1: os: latest-beta node-version: 12.9.1 requires: - build-latest-beta-10.9.0 - build-latest-beta-11.9.0 - build-latest-beta-13.9.0 - build-latest-beta-11.9.0 - test-latest-beta-13.9.0: os: latest-beta node-version: 13.9.0 requires: - build-latest-beta-10.9.0 - build-latest-beta-11.9.0 - build-latest-beta-13.9.0 - build-latest-beta-11.9.0etc...If the matrix feature is in workflow level the config will be more simplified. The setting creates 8 workflows, and each workflow has build and test jobs.workflows: version: 2 workflow: matrix: parameters: os: ["latest-beta", "latest-release"] node-version: ["10.9.0", "11.9.0", "12.9.1", "13.9.0"] jobs: - build - test: requires: - build↓ compileworkflows: version: 2 workflow-latest-beta-10.9.0: jobs: - build: os: latest-beta node-version: 10.9.0 - test: os: latest-beta node-version: 10.9.0 requires: - build workflow-latest-release-10.9.0: jobs: - build: os: latest-release node-version: 10.9.0 - test: os: latest-release node-version: 10.9.0 requires: - buildetc...
CCI-I-1705
Gavin Clarke
This only really works if the link between matrix parameters and job parameters is broken (no bad thing), otherwise you'd need to ensure every job in the workflow takes the same parameters. If that happens then this would be useful