forked from mosdef-hub/foyer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
180 lines (158 loc) · 5.56 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
trigger:
branches:
include:
- master
tags:
include:
- 0.*
pr:
autoCancel: true
branches:
include:
- master
paths:
exclude:
- docs
schedules:
- cron: "0 0 * * *"
displayName: Daily midnight build for master
branches:
include:
- master
always: true
stages:
- stage: Test
jobs:
- job: NoBleeding
strategy:
matrix:
Python37Ubuntu:
imageName: 'ubuntu-latest'
python.version: 3.7
Python38Ubuntu:
imageName: 'ubuntu-latest'
python.version: 3.8
Python39Ubuntu:
imageName: 'ubuntu-latest'
python.version: 3.9
Python37macOS:
imageName: 'macOS-latest'
python.version: 3.7
Python38macOS:
imageName: 'macOS-latest'
python.version: 3.8
Python39macOS:
imageName: 'macOS-latest'
python.version: 3.9
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
displayName: Add relavent Channels
- bash: |
conda install -c conda-forge mamba
displayName: Install mamba
- bash: |
sed -i -E 's/python.*$/python='$(python.version)'/' environment-dev.yml
mamba env create -f environment-dev.yml
source activate foyer-dev
pip install -e .
cd src/antefoyer
pip install -e .
displayName: Create Conda env, Activate, Install dependencies, Install Branch
- bash: |
source activate foyer-dev
python -m pytest -v --cov=foyer --cov-report=html --color=yes --pyargs foyer --cov-config=setup.cfg
displayName: Run Tests
- bash: |
source activate foyer-dev
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_UPLOAD_TOKEN} -C $(Build.SourceVersion)
condition: and( eq( variables['Agent.OS'], 'Linux' ), eq( variables['python.version'], '3.7' ) )
displayName: Upload coverage report to codecov.io
env:
CODECOV_UPLOAD_TOKEN: $(codecovUploadToken)
- job: Windows_no_bleeding
pool:
vmImage: 'windows-latest'
strategy:
matrix:
Python37:
python.version: 3.7
Python38:
python.version: 3.8
Python39:
python.version: 3.9
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
displayName: Add Relevent Channels
- script: |
sed -i -E 's/python.*$/python='$(python.version)'/' environment-dev-win.yml
conda env create -f environment-dev-win.yml
call activate foyer-dev
pip install -e .
cd src/antefoyer
pip install -e .
displayName: Create conda env, Install dependencies and Install Branch
- script: |
call activate foyer-dev
python -m pytest -v --cov=foyer --color=yes --pyargs foyer
displayName: Run Tests
- job: LinuxBleeding
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 install -c conda-forge mamba
git clone https://github.com/mosdef-hub/mbuild.git
git clone https://git.luolix.top.mosdef-hub/gmso.git
mamba env create --name bleeding --file environment-dev.yml
source activate bleeding
mamba env update --name bleeding --file mbuild/environment.yml
pip install -e mbuild
mamba env update --name bleeding --file gmso/environment.yml
pip install -e gmso
pip install -e .
pip install -e src/antefoyer
displayName: Create a new bleeding test environment
- bash: |
source activate bleeding
python -m pytest -v --cov=foyer --cov-report=html --color=yes --pyargs foyer
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/foyer
tags: latest
- task: Docker@2
displayName: Logout
inputs:
command: logout
containerRegistry: mosdefDockerLogin