This feature was requested in e.g. https://stackoverflow.com/questions/46575415/can-i-multiply-options-in-matrix-include-with-the-env-option , https://github.com/travis-ci/travis-ci/issues/1519 .
The stumbling block seems to be that the root level of
.travis.yml is a hash table, so it can’t have duplicate keys, nor can it contain list entries.
However, YAML supports lists of lists:
env: - - VAR1=foo - VAR1=bar - - VAR2=baz - VAR2=xyzzy
and detecting a list of lists as opposed to a regular list is rather straightforward.
I would not allow both regular list entries and these nested ones, as well as deeper nesting, 'cuz that would rather be submatrices to build matrix – and unrelated complex problems will arise like if parent values should be inherited. For now, I’m only suggesting an equivalent to multiple
(The implementation should be straightforward but I don’t know Ruby so would like to get some feedback before I consider investing significant time into learning it to write a PR.)