-
Notifications
You must be signed in to change notification settings - Fork 4
/
azure-pipelines.yml
67 lines (67 loc) · 2.4 KB
/
azure-pipelines.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
61
62
63
64
65
66
67
jobs:
- job: 'Test'
strategy:
matrix:
LinuxPython36:
python.version: '3.6'
image.name: 'ubuntu-18.04'
LinuxPython37:
python.version: '3.7'
image.name: 'ubuntu-18.04'
LinuxPython38:
python.version: '3.8'
image.name: 'ubuntu-18.04'
WindowsPython36:
python.version: '3.6'
image.name: 'windows-2019'
WindowsPython37:
python.version: '3.7'
image.name: 'windows-2019'
WindowsPython38:
python.version: '3.8'
image.name: 'windows-2019'
MacPython36:
python.version: '3.6'
image.name: 'macOS-10.14'
MacPython37:
python.version: '3.7'
image.name: 'macOS-10.14'
MacPython38:
python.version: '3.8'
image.name: 'macOS-10.14'
maxParallel: 9
pool:
vmImage: '$(image.name)'
steps:
- task: UsePythonVersion@0
condition: succeeded()
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: python -m pip install --upgrade pip setuptools wheel
condition: succeeded()
displayName: 'Install tools'
- script: python -m pip install pytest pytest-cov numpy pandas scipy
condition: succeeded()
displayName: 'Install test requirements'
- script: python -m pip install torch==1.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
condition: or(startsWith(variables['image.name'], 'windows'), startsWith(variables['image.name'], 'ubuntu'))
displayName: 'Install pytorch (windows/linux)'
- script: python -m pip install torch
condition: startsWith(variables['image.name'], 'macOS')
displayName: 'Install pytorch (mac)'
- script: |
python -m pytest --doctest-modules --junitxml=junit/test-results.xml --cov=slicer --cov-report=xml --cov-report=html
displayName: 'Run pytest'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version) at $(image.name)'
displayName: 'Publish test results'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
displayName: 'Publish test coverage results'