Change parameter matrix to list instead of dict
This commit is contained in:
@@ -11,27 +11,27 @@ parameters:
|
||||
- name: matrix
|
||||
type: object
|
||||
default:
|
||||
UbuntuPython38:
|
||||
- job_name: 'UbuntuPython38'
|
||||
py: '3.8'
|
||||
img: 'ubuntu-latest'
|
||||
only_pr: false
|
||||
UbuntuPython310:
|
||||
- job_name: 'UbuntuPython310'
|
||||
py: '3.10'
|
||||
img: 'ubuntu-latest'
|
||||
only_pr: true
|
||||
WindowsPython38:
|
||||
- job_name: 'WindowsPython38'
|
||||
py: '3.8'
|
||||
img: 'windows-latest'
|
||||
only_pr: false
|
||||
WindowsPython310:
|
||||
- job_name: 'WindowsPython310'
|
||||
py: '3.10'
|
||||
img: 'windows-latest'
|
||||
only_pr: false
|
||||
MacOSPython38:
|
||||
- job_name: 'MacOSPython38'
|
||||
py: '3.8'
|
||||
img: 'macOS-latest'
|
||||
only_pr: false
|
||||
MacOSPython310:
|
||||
- job_name: 'MacOSPython310'
|
||||
py: '3.10'
|
||||
img: 'macOS-latest'
|
||||
only_pr: false
|
||||
@@ -40,15 +40,15 @@ stages:
|
||||
- stage: Test
|
||||
jobs:
|
||||
- ${{ each item in parameters.matrix }}:
|
||||
${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.Value.only_pr) }}:
|
||||
- job: ${{ item.Key }}
|
||||
${{ if or(eq(variables['Build.Reason'], 'PullRequest'), item.only_pr) }}:
|
||||
- job: ${{ item.job_name }}
|
||||
pool:
|
||||
vmImage: ${{ item.Value.img }}
|
||||
vmImage: ${{ item.img }}
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: ${{ item.Value.py }}
|
||||
displayName: 'Use Python ${{ item.Value.py }}'
|
||||
versionSpec: ${{ item.py }}
|
||||
displayName: 'Use Python ${{ item.py }}'
|
||||
|
||||
- script: |
|
||||
python -m pip install pre-commit
|
||||
|
||||
Reference in New Issue
Block a user