forked from scverse/scanpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.azure-pipelines.yml
110 lines (93 loc) · 2.85 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
trigger:
- master
variables:
python.version: '3.9'
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
ANNDATA_DEV: no
RUN_COVERAGE: no
TEST_EXTRA: 'test-full'
jobs:
- job: PyTest
pool:
vmImage: 'ubuntu-18.04'
strategy:
matrix:
Python37:
python.version: '3.7'
Python39: {}
minimal_tests:
TEST_EXTRA: 'test-min'
anndata_dev:
python.version: '3.9'
ANNDATA_DEV: yes
RUN_COVERAGE: yes
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'
- task: Cache@2
inputs:
key: '"python $(python.version)" | "$(Agent.OS)" | pyproject.toml'
restoreKeys: |
python | "$(Agent.OS)"
python
path: $(PIP_CACHE_DIR)
displayName: Cache pip packages
- script: |
export MPLBACKEND="agg"
echo $MPLBACKEND
displayName: 'Set env'
- script: |
python -m pip install --upgrade pip
pip install pytest-cov wheel
pip install .[dev,$(TEST_EXTRA)]
displayName: 'Install dependencies'
- script: |
pip install -v git+https://github.com/scverse/anndata
displayName: 'Install development anndata'
condition: eq(variables['ANNDATA_DEV'], 'yes')
- script: |
pip list
displayName: 'Display installed versions'
- script: |
pytest --color=yes --ignore=scanpy/tests/_images --nunit-xml="nunit/test-results.xml"
displayName: 'PyTest'
condition: eq(variables['RUN_COVERAGE'], 'no')
- script: |
pytest --color=yes --ignore=scanpy/tests/_images --nunit-xml="nunit/test-results.xml" --cov=scanpy --cov-report=xml
displayName: 'PyTest (coverage)'
condition: eq(variables['RUN_COVERAGE'], 'yes')
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
condition: eq(variables['RUN_COVERAGE'], 'yes')
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: 'nunit/test-results.xml'
testResultsFormat: NUnit
testRunTitle: 'Publish test results for Python $(python.version)'
- script: bash <(curl -s https://codecov.io/bash)
displayName: 'Upload to codecov.io'
condition: eq(variables['RUN_COVERAGE'], 'yes')
- job: CheckBuild
pool:
vmImage: 'ubuntu-18.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
displayName: 'Use Python 3.9'
- script: |
python -m pip install --upgrade pip
pip install build twine
displayName: 'Install build tools and requirements'
- script: pip list
displayName: 'Display installed versions'
- script: |
python -m build --sdist --wheel .
twine check dist/*
displayName: 'Build & Twine check'