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

How to not Allow Some Matrices Together

Solved! Go to Solution.

The actual question.

 

Is there a way to ban some matrix combinations in Github Actions?

 

The problem is described better on StackOverflow, so I gave link to that. The answers on both platforms are welcome.

3 Replies
Highlighted
Solution
Copilot Lvl 2
Message 2 of 4

Re: How to not Allow Some Matrices Together

Example excluding configurations from a matrix 

This should work.

matrix:
  python-version: [3.5, 3.6, 3.7]
  django-version: [1.11, 2.0, 2.1, 2.2]
  
  exclude:
    - python-version: 3.7
      django-version: 1.11

 

Copilot Lvl 2
Message 3 of 4

Re: How to not Allow Some Matrices Together

What if I have to exclude multiple versions, such as excluding:

 - py3.7 and dj1.11

 - py3.8 and dj1.11

 

Apparently, `python-version: [3.7, 3.8]` will not work.

 

Edit: Okay okay, I think I can manage it with `if`.

Highlighted
Copilot Lvl 2
Message 4 of 4

Re: How to not Allow Some Matrices Together

Just add another exclude for `python3.8`


matrix:
  python-version: [3.5, 3.6, 3.7, 3.8]
  django-version: [1.11, 2.0, 2.1, 2.2]
  
  exclude:
    - python-version: 3.7
      django-version: 1.11
    - python-version: 3.8
      django-version: 1.11