How does `parallel` and `parallel:matrix` work in GitLab?
IntermediateConceptGitLab CI
Answer
parallel: 5 creates five copies with CI_NODE_INDEX and CI_NODE_TOTAL set, so a test runner can shard its suite. parallel:matrix creates a job per variable combination.
test:
parallel:
matrix:
- PYTHON: ['3.11', '3.12']
DB: [postgres, mysql]
image: python:$PYTHON
script: pytest --db $DB
More on GitLab CI
How does GitLab CI/CD work at a high level?BeginnerWhat is a GitLab Runner and what executors exist?IntermediateWhat are the types of runners (shared, group, project) and tags?IntermediateHow do `rules:` work and how do they replace `only/except`?IntermediateWhat are workflow rules and how do they prevent duplicate pipelines?AdvancedHow do artifacts and cache differ in GitLab CI?Intermediate