-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-job.yml
41 lines (35 loc) · 1.23 KB
/
azure-job.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
parameters:
pythons: []
images: []
extra_cmds: []
jobs:
- ${{ each python in parameters.pythons }}:
- job: ${{ coalesce(python.value.name, python.key) }}
strategy:
matrix:
${{ each image in parameters.images }}:
${{ image }}:
image_name: ${{ coalesce(image, 'linux') }}
${{ if eq(image, 'linux') }}:
image: 'Ubuntu-16.04'
${{ if eq(image, 'windows') }}:
image: 'windows-2019'
${{ if eq(image, 'macOs') }}:
image: 'macOS-10.14'
${{ if notIn(image, 'macOs', 'linux', 'windows') }}:
image: ${{ coalesce(image, 'Ubuntu-16.04') }}
pool:
vmImage: $[ variables.image ]
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '${{ python.value.spec }}'
architecture: 'x64'
displayName: Use cached Python ${{ python.value.spec }} for tests.
- script: pip install -r requirements-ci.txt
displayName: Install CI requirements
- ${{ each cmd in parameters.extra_cmds }}:
- script: ${{ cmd.value.cmd }}
displayName: ${{ cmd.value.name }}
- script: pytest
displayName: Run pytest (Python ${{ python.value.spec }})