Change parameter matrix to list instead of dict

This commit is contained in:
Marek Wolan
2023-07-11 08:22:30 +00:00
parent 3085057406
commit 98414a58f3

View File

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