Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add cross-product matrix strategy #20
By "cross-product matrix", I mean the scenario where you want to use the
strategy: matrix: Linux_Python36: VM_IMAGE: 'ubuntu-16.04' PYTHON_VERSION: '3.6' Linux_Python37: VM_IMAGE: 'ubuntu-16.04' PYTHON_VERSION: '3.7' Windows_Python36: VM_IMAGE: 'vs2017-win2016' PYTHON_VERSION: '3.6' Windows_Python37: VM_IMAGE: 'vs2017-win2016' PYTHON_VERSION: '3.7'
While this isn't too bad with a small number of dimensions and a small number of variables in each dimension, it can quickly become unmaintainable as the dimensions and variables grow. It would be nice if there was a way to express this more succinctly, something like:
strategy: cross-product: PYTHON_VERSION: [ '3.6', '3.7' ] VM_IMAGE: [ `ubuntu-16.04`, `vs2017-win2016` ]
The concept is good. A handful of issues to think on.
I need to predictably generate job names (in the current unrolled syntax,
I also need to handle exceptions as a subkey of
strategy: cross-product: vars: PYTHON_VERSION: [ '3.6', '3.7', '2.7' ] VM_IMAGE: [ 'ubuntu-16.04', 'vs2017-win2016' ] except: - PYTHON_VERSION: '2.7' # skip Python 2.7 on Windows VM_IMAGE: 'vs2017-win2016'
Overall this looks great. In combination with #4, it should be perfect for our current requirements.
A few questions about the job name:
- job: 'Test' strategy: matrix: Python36: python.version: '3.6' Python37: python.version: '3.7' - job: 'Publish' dependsOn: 'Test'
Hmm, I need to think more about
Regarding a name: we have restrictions on what you can name jobs (most obvious one, no spaces) but wouldn't want to restrict values that way. I guess if we added some new functions - maybe