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
All CI/CD questions Roadmap: GitLab CI/CD

More on GitLab CI