Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 4

Questions Regarding `exclude` parameters

Hello - 

 

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
However when I look at the builds being generated, I still see combinations like python 2.7/pandas 0.18.1/numpy 1.17.4 being generated. What's the right syntax to exclude all combinations of certain libraries for being run? Or is the matrix the wrong way to specify this?
 
For reference:

 

3 Replies
Highlighted
GitHub Partner
Message 2 of 4

Re: Questions Regarding `exclude` parameters

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 ?  

 

Highlighted
Copilot Lvl 2
Message 3 of 4

Re: Questions Regarding `exclude` parameters

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?

 

 

 

 

Highlighted
GitHub Partner
Message 4 of 4

Re: Questions Regarding `exclude` parameters

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.

matrix include.png