forked from py-why/EconML
-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines-steps.yml
60 lines (50 loc) · 2.18 KB
/
azure-pipelines-steps.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
parameters:
package: '-e .'
images: ['ubuntu-18.04', 'macOS-10.15', 'windows-2019']
versions: ['3.6', '3.7', '3.8']
job:
job: Job
jobs:
- job: ${{ parameters.job.job }}
variables:
${{ if ge(length(parameters.images), 2) }}:
imgPart: ", {0}"
${{ if lt(length(parameters.images), 2) }}:
imgPart: ""
${{ if ge(length(parameters.versions), 2) }}:
verPart: ", Python {1}"
${{ if lt(length(parameters.versions), 2) }}:
verPart: ""
strategy:
matrix:
${{ each image in parameters.images }}:
${{ each version in parameters.versions }}:
${{ format(format('{0}{1} ', variables.imgPart, variables.verPart), image, version) }}:
imageName: ${{ image }}
python.version: ${{ version }}
pool:
vmImage: $(imageName)
${{ each pair in parameters.job }}: # Insert all properties other than "strategy", "pool", "steps", "variables", "job"
${{ if notIn(pair.key, 'strategy', 'pool', 'steps', 'variables', 'job') }}:
${{ pair.key }}: ${{ pair.value }}
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
inputs:
versionSpec: '$(python.version)'
# Enable long path support on Windows so that all packages can be installed correctly
- script: 'reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f'
displayName: 'Enable long paths on Windows'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
# Install graphviz programmatically on Linux
- script: 'sudo apt-get -yq install graphviz'
displayName: 'Install graphviz on Linux'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
# Install the package
- script: 'python -m pip install --upgrade pip && pip install --upgrade setuptools wheel Cython && pip install ${{ parameters.package }}'
displayName: 'Install dependencies'
- ${{ parameters.job.steps }}