forked from mosdef-hub/foyer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
154 lines (132 loc) · 4.86 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
trigger:
- master
pr:
- 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 janschulz
conda config --add channels conda-forge
conda config --add channels mosdef
displayName: Add relavent Channels
- bash: |
conda create -n test-environment python=$(python.version) --file requirements-dev.txt
source activate test-environment
pip install -e .
displayName: Create Conda env, Activate, Install dependencies, Install Branch
- bash: |
source activate test-environment
python -m pytest -v --cov=foyer --cov-report= --pyargs foyer
displayName: Run Tests
- 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 Relevent Channels
- script: |
conda create -n test-environment python=$(python.version) --file requirements-dev.txt
call activate test-environment
pip install -e .
displayName: Create conda env, Install dependencies and Install Branch
- script: |
call activate test-environment
python -m pytest -v --cov=foyer --cov-report= --pyargs foyer
displayName: Run Tests
- job: LinuxBleedingMbuild
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 create -n bleeding-test-environment python=3.7 --file requirements-dev.txt
source activate bleeding-test-environment
displayName: Create a new bleeding test environment
- bash: |
source activate bleeding-test-environment
git clone https://github.com/mosdef-hub/mbuild.git
cd mbuild
conda install --yes --file requirements-dev.txt
pip install -e .
pip uninstall foyer -y
cd ..
pip install -e .
displayName: Clone mbuild, install mbuild, install foyer
- bash: |
source activate bleeding-test-environment
python -m pytest -v --cov=foyer --cov-report= --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