I'm trying to use Github Actions to test a python module across a variety of python versions/pandas versions/numpy versions. Particular combinations have known issues installing so I'm trying to use the exclude syntax to not run those:
matrix: os: [ubuntu-latest, windows-latest, macos-latest] numpy: [1.11.3, 1.17.4] pandas: [0.18.1, 0.25.3] python-version: [2.7, 3.5, 3.7, 3.8] exclude: - python-version: 2.7 pandas: 0.25.3 numpy: 1.17.4 - python-version: 3.7 pandas: 0.18.1 numpy: 1.11.3 - python-version: 3.8 pandas: 0.18.1 numpy: 1.11.3
According to your matrix setting, you have 4 matrixs: os, numpy, pandas and python-version.
This will create 48 jobs (3 os × 2 numpy × 2 pandas × 4 python-version ) . And you exclude three combinations of numpy, pandas and python-version. This will exclude 9 (3 × 3 os) jobs which match this condition.
So your settings will create a total of 39 jobs. It doesn’t exclude python 2.7/pandas 0.18.1/numpy 1.17.4
There is the document for excluding configurations from a matrix https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-...
What’s your exact requirement? Which particular combinations do you want exclude? Or you could change your view on include ?
Semantically, what' I'd like to do is something like:
For all os values:
- if the build is python 2.7 or 3.5 only use numpy == 1.11.3 and pandas == 0.18.1
- Otherwise (python 3.6/3.7/3.8) use numpy == 1.17.4 and pandas == 0.25.3 (or perhaps some other array of values).
Is the right way to do this to be more specific in my exclude? Or only pass in versions in include?
In your scenario, I recommend you use include, set numpy and pandas as additional configuration options .
And I checked your workflow yml, this is exactly what I recommend.