/
azure-pipelines.yml
164 lines (128 loc) · 3.81 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# This is the configuration file for Gammapy on Azure Pipelines
variables:
GAMMAPY_DATA: $(Agent.HomeDirectory)/gammapy-data
jobs:
- job: 'Test'
strategy:
matrix:
Python36:
imageName: 'ubuntu-16.04'
python.version: '3.6'
Windows36:
imageName: 'vs2017-win2016'
python.version: '3.6'
Windows37:
imageName: 'vs2017-win2016'
python.version: '3.7'
pool:
vmImage: $(imageName)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: |
python -m pip install --upgrade pip setuptools wheel
pip install pytest pytest-cov cython numpy astropy regions pyyaml click pytest-astropy parfive tqdm requests pydantic pytest-astropy-header
pip install matplotlib reproject iminuit
displayName: 'Install dependencies'
- script: |
pip install -e .
python -m gammapy info
displayName: 'Install Gammapy'
- script: |
gammapy download datasets --out=$(GAMMAPY_DATA) --silent --tests
displayName: 'Get GAMMAPY_DATA'
- script: |
pytest gammapy --junitxml=junit/test-results.xml
displayName: 'Run pytest'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()
- job: 'TestNotebooks'
pool:
vmImage: 'vs2017-win2016'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'
- script: |
python -m pip install --upgrade pip setuptools wheel
pip install cython numpy astropy regions pyyaml click parfive tqdm requests pydantic jupyter
pip install matplotlib reproject iminuit emcee corner
displayName: 'Install dependencies'
- script: |
pip install -e .
python -m gammapy info
displayName: 'Install Gammapy'
- script: |
gammapy download datasets --out=$(GAMMAPY_DATA) --silent --tests
displayName: 'Get GAMMAPY_DATA'
- script: |
make test-nb
displayName: 'Run jupyter notebook tests'
- job: 'Lint'
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'
- bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
displayName: Add conda to PATH
- script: |
conda env create --file environment-dev.yml
source activate gammapy-dev
pip install -e .
gammapy info
displayName: 'Create gammapy-dev conda environment'
- script: |
source activate gammapy-dev
make flake8
exit 0 # allow fail
displayName: 'Run flake8'
- script: |
source activate gammapy-dev
make pylint
exit 0 # allow fail
displayName: 'Run pylint'
- script: |
source activate gammapy-dev
make pydocstyle
exit 0 # allow fail
displayName: 'Run pydocstyle'
- job: 'DevDocs'
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'
- bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
displayName: Add conda to PATH
- script: |
conda env create --file environment-dev.yml
source activate gammapy-dev
pip install -e .
gammapy info
displayName: 'Create gammapy-dev conda environment'
- script: |
source activate gammapy-dev
gammapy download datasets --out=$(GAMMAPY_DATA) --silent --tests
displayName: 'Get GAMMAPY_DATA'
- script: |
source activate gammapy-dev
python -m gammapy.utils.tutorials_process
displayName: 'Run tutorial Jupyter notebooks'
- script: |
source activate gammapy-dev
make docs-sphinx
displayName: 'Run Sphinx documentation build'
- script: |
echo TODO
displayName: 'Push HTML to Github pages'