Built matrix conditionally
This commit is contained in:
@@ -8,30 +8,29 @@ trigger:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
UbuntuPython38:
|
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
||||||
python.version: '3.8'
|
UbuntuPython38:
|
||||||
imageName: 'ubuntu-latest'
|
python.version: '3.8'
|
||||||
condition: eq(variables['Build.Reason'], 'PullRequest')
|
imageName: 'ubuntu-latest'
|
||||||
UbuntuPython310:
|
UbuntuPython310:
|
||||||
python.version: '3.10'
|
python.version: '3.10'
|
||||||
imageName: 'ubuntu-latest'
|
imageName: 'ubuntu-latest'
|
||||||
WindowsPython38:
|
WindowsPython38:
|
||||||
python.version: '3.8'
|
python.version: '3.8'
|
||||||
imageName: 'windows-latest'
|
imageName: 'windows-latest'
|
||||||
condition: eq(variables['Build.Reason'], 'PullRequest')
|
WindowsPython310:
|
||||||
WindowsPython310:
|
python.version: '3.10'
|
||||||
python.version: '3.10'
|
imageName: 'windows-latest'
|
||||||
imageName: 'windows-latest'
|
MacOSPython38:
|
||||||
condition: eq(variables['Build.Reason'], 'PullRequest')
|
python.version: '3.8'
|
||||||
MacOSPython38:
|
imageName: 'macOS-latest'
|
||||||
python.version: '3.8'
|
MacOSPython310:
|
||||||
imageName: 'macOS-latest'
|
python.version: '3.10'
|
||||||
condition: eq(variables['Build.Reason'], 'PullRequest')
|
imageName: 'macOS-latest'
|
||||||
MacOSPython310:
|
${{ if not(eq(variables['Build.Reason'], 'PullRequest')) }}:
|
||||||
python.version: '3.10'
|
UbuntuPython310:
|
||||||
imageName: 'macOS-latest'
|
python.version: '3.10'
|
||||||
condition: eq(variables['Build.Reason'], 'PullRequest')
|
imageName: 'ubuntu-latest'
|
||||||
# pretty sure this does not support a 'condition' parameter but worth a try. Otherwise a more complicated solution might be warranted.
|
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: $(imageName)
|
vmImage: $(imageName)
|
||||||
|
|||||||
Reference in New Issue
Block a user