Make it possible to define a cartesian product/matrix for build jobs

Currently we can define a something like a build matrix using a hidden job, and using a YAML format features to inherit configuration. But this means that we have to define each job explicitly. Maybe adding support for defining build jobs dynamically using special configuration entries would save some configuration effort, which may be especially true since we support environments.

Example of .travis.yml

rvm:
  - 1.9.3
  - 2.0.0
  - 2.2
  - ruby-head
  - jruby
  - rbx-2
  - ree
gemfile:
  - gemfiles/Gemfile.rails-2.3.x
  - gemfiles/Gemfile.rails-3.0.x
  - gemfiles/Gemfile.rails-3.1.x
  - gemfiles/Gemfile.rails-edge
env:
  - ISOLATED=true
  - ISOLATED=false

This produces 56 individual jobs.

Real life example provided by @MrChrisW:

Travis docs: Build matrix

Also, GitHub CI/CD is planning the same feature: https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstrategy

Related issues https://gitlab.com/gitlab-org/gitlab-ce/issues/13755, https://gitlab.com/gitlab-org/gitlab-ce/issues/19198

/cc @MrChrisW @markpundsack @ayufan

Edited by Jason Yavorsky