forked from mosdef-hub/mbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
198 lines (168 loc) · 6.63 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
trigger:
- master
pr:
autoCancel: true
branches:
include:
- master
schedules:
- cron: "0 0 * * *"
displayName: Daily midnight build for master
branches:
include:
- master
always: true
stages:
- stage: Test
jobs:
- job: NoBleeding
strategy:
matrix:
Python36Ubuntu:
imageName: 'ubuntu-latest'
python.version: 3.6
Python37Ubuntu:
imageName: 'ubuntu-latest'
python.version: 3.7
Python36macOS:
imageName: 'macOS-latest'
python.version: 3.6
Python37macOS:
imageName: 'macOS-latest'
python.version: 3.7
pool:
vmImage: $(imageName)
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add Conda to path
- bash: sudo chown -R $USER $CONDA
condition: eq( variables['Agent.OS'], 'Darwin' )
displayName: Take ownership of conda installation
- bash: |
conda config --set always_yes yes --set changeps1 no
conda config --add channels omnia
conda config --add channels conda-forge
conda config --add channels mosdef
displayName: Add relavent Channels
- bash: |
conda update -c defaults conda
conda update --all
conda create -n test-environment
source activate test-environment
conda install --yes python=$(python.version) --file requirements-dev.txt
conda install --yes python=$(python.version) --file requirements-dev.txt
pip install -e .
displayName: Create Conda env, Activate, Install dependencies, Install Branch
- bash: |
source activate test-environment
pip install pytest-azurepipelines
python -m pytest -v --pyargs mbuild --cov=mbuild --no-coverage-upload
displayName: Run Tests
- bash: |
source activate test-environment
coverage xml
codecov --file ./coverage.xml --token 2b64a140-cfdd-4d0f-b1ba-33d34b8bf522
coverage html
condition: and( eq( variables['Agent.OS'], 'Linux' ), eq( variables['python.version'], '3.7' ) )
displayName: Upload Coverage Report
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
condition: and( eq( variables['Agent.OS'], 'Linux' ), eq( variables['python.version'], '3.7' ) )
displayName: Publish Coverage Report
- job: Windows_no_bleeding
pool:
vmImage: 'windows-latest'
strategy:
matrix:
Python36:
python.version: 3.6
Python37:
python.version: 3.7
steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add Conda to path
- script: |
conda config --set always_yes yes --set changeps1 no
conda config --add channels omnia
conda config --add channels conda-forge
conda config --add channels mosdef
displayName: Add relavent channels
- script: |
conda update -c defaults conda
conda update --all
conda create -n test-environment
call activate test-environment
conda install --yes python=$(python.version) --file requirements-dev.txt
conda install --yes python=$(python.version) --file requirements-dev.txt
displayName: Create Conda env, Activate, Install dependencies
- script: |
call activate test-environment
python -m pip --version
python -m pip --verbose install -e .
displayName: Install mBuild
- script: |
call activate test-environment
python -m pip install pytest-azurepipelines
python -m pytest -v --cov=mbuild --cov-report=html --pyargs mbuild --no-coverage-upload
displayName: Run Tests
- job: LinuxBleedingFoyer
pool:
vmImage: 'ubuntu-latest'
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add Conda to path
- bash: |
conda config --set always_yes yes --set changeps1 no
conda config --add channels omnia
conda config --add channels conda-forge
conda config --add channels mosdef
conda update -c defaults conda
conda update --all
conda create -n bleeding-test-environment
source activate bleeding-test-environment
conda install --yes python=3.7 --file requirements-dev.txt
conda install --yes python=3.7 --file requirements-dev.txt
displayName: Create a new bleeding test environment
- bash: |
source activate bleeding-test-environment
git clone https://github.com/mosdef-hub/foyer.git
cd foyer
conda install --yes --file requirements-dev.txt
conda install --yes --file requirements-dev.txt
pip install -e .
pip uninstall mbuild -y
cd ..
pip install -e .
displayName: clone foyer, install foyer, install mbuild
- bash: |
source activate bleeding-test-environment
pip install pytest-azurepipelines
python -m pytest -v --cov=mbuild --cov-report= --pyargs mbuild --no-coverage-upload
displayName: Run Tests
- stage: Docker
dependsOn: Test
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), ne(variables['Build.Reason'], 'Schedule'))
pool:
vmImage: 'ubuntu-latest'
jobs:
- job: publishDocker
steps:
- task: Docker@2
displayName: Login to docker hub
inputs:
command: login
containerRegistry: mosdefDockerLogin
- task: Docker@2
displayName: Build and Push
inputs:
command: buildAndPush
repository: mosdef/mbuild
tags: latest
- task: Docker@2
displayName: Logout
inputs:
command: logout
containerRegistry: mosdefDockerLogin