-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
228 lines (205 loc) · 8.45 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# Psi4 pipeline
trigger:
- master
variables:
mkl.version: '2019.1'
jobs:
# Configure, build, install, and test job
- job: 'build'
pool:
vmImage: 'vs2015-win2012r2'
timeoutInMinutes: 360
steps:
# Check Python
- script: |
setlocal EnableDelayedExpansion
echo python.version: %PYTHON_VERSION%
set VALID=false
if "%PYTHON_VERSION%"=="3.6" set VALID=true
if "%PYTHON_VERSION%"=="3.7" set VALID=true
if "!VALID!"=="false" (
echo ERROR: Invalid "python.version" value: "%PYTHON_VERSION%". Valid values: "3.6" and "3.7".
exit 1
)
displayName: "Check Python version: $(python.version)"
# Check cmake configuration
- script: |
setlocal EnableDelayedExpansion
echo cmake.build_type: %CMAKE_BUILD_TYPE%
set VALID=false
if "%CMAKE_BUILD_TYPE%"=="Debug" set VALID=true
if "%CMAKE_BUILD_TYPE%"=="Release" set VALID=true
if "!VALID!"=="false" (
echo ERROR: Invalid "cmake.build_type" value: "%CMAKE_BUILD_TYPE%". Valid values: "Debug" and "Release".
exit 1
)
displayName: "Check cmake configuration"
# Check ctest configuration
- script: |
setlocal EnableDelayedExpansion
echo ctest.type: %CTEST_TYPE%
set VALID=false
if "%CTEST_TYPE%"=="quick" set VALID=true
if "%CTEST_TYPE%"=="full" set VALID=true
if "!VALID!"=="false" (
echo ERROR: Invalid "ctest.type" value: "%CTEST_TYPE%". Valid values: "quick" and "full".
exit 1
)
displayName: "Check ctest configuration"
# Check pytest configuration
- script: |
setlocal EnableDelayedExpansion
echo pytest.type: %PYTEST_TYPE%
set VALID=false
if "%PYTEST_TYPE%"=="quick" set VALID=true
if "%PYTEST_TYPE%"=="full" set VALID=true
if "!VALID!"=="false" (
echo ERROR: Invalid "pytest.type" value: "%PYTEST_TYPE%". Valid values: "quick" and "full".
exit 1
)
displayName: "Check pytest configuration"
# Check conda configuration
- script: |
setlocal EnableDelayedExpansion
echo conda.build: %CONDA_BUILD%
set VALID=false
if "%CONDA_BUILD%"=="true" set VALID=true
if "%CONDA_BUILD%"=="false" set VALID=true
if "!VALID!"=="false" (
echo ERROR: Invalid "conda.build" value: "%CONDA_BUILD%". Valid values: "true" and "false".
exit 1
)
displayName: "Check conda configuration"
# Install Chocolatey (https://chocolatey.org/install#install-with-powershellexe)
- powershell: |
Set-ExecutionPolicy Bypass -Scope Process -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Write-Host "##vso[task.setvariable variable=PATH]$env:PATH"
choco --version
displayName: "Install Chocolatey"
# Install Miniconda
- script: |
choco install miniconda3 --yes
set PATH=C:\tools\miniconda3\Scripts;C:\tools\miniconda3;C:\tools\miniconda3\Library\bin;%PATH%
echo '##vso[task.setvariable variable=PATH]%PATH%'
set LIB=C:\tools\miniconda3\Library\lib;%LIB%
echo '##vso[task.setvariable variable=LIB]%LIB%'
conda --version
displayName: "Install Miniconda"
# Configure Miniconda
- script: |
conda config --set always_yes yes
conda config --append channels conda-forge
conda config --append channels psi4
conda info
displayName: "Configure Miniconda"
# Create conda enviroment
# Note: conda activate doesn't work here, because it creates a new shell!
- script: |
conda install cmake ^
conda-build ^
conda-verify ^
deepdiff ^
intel-openmp=%MKL_VERSION% ^
mkl-devel=%MKL_VERSION% ^
mpmath ^
networkx ^
ninja ^
numpy ^
pybind11 ^
pytest ^
python=%PYTHON_VERSION% ^
qcelemental ^
qcengine
conda list
displayName: "Install conda packages"
# Install LLVM
# Note: LLVM distributed by conda is too old
- script: |
choco install llvm --yes
set PATH=C:\Program Files\LLVM\bin;%PATH%
echo '##vso[task.setvariable variable=PATH]%PATH%'
clang-cl --version
displayName: "Install LLVM"
# Install Intel OpenMP import library
# NOTE: libiomp5md.lib is located in conda/win/$(mkl.version)
- script: |
set LIB=$(Build.SourcesDirectory)\conda\win\$(mkl.version);%LIB%
echo '##vso[task.setvariable variable=LIB]%LIB%'
displayName: "Install Intel OpenMP import library"
# Configure
- script: |
setlocal EnableDelayedExpansion
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
mkdir build & cd build
if "%CMAKE_BUILD_TYPE%"=="Debug" set MAX_AM_ERI=6
if "%CMAKE_BUILD_TYPE%"=="Release" set MAX_AM_ERI=8
if not defined MAX_AM_ERI exit 1
if "%CMAKE_BUILD_TYPE%"=="Debug" set ENABLE_XHOST=OFF
if "%CMAKE_BUILD_TYPE%"=="Release" set ENABLE_XHOST=ON
if not defined ENABLE_XHOST exit 1
cmake -G Ninja ^
-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
-DCMAKE_INSTALL_PREFIX=../install ^
-DCMAKE_C_COMPILER=clang-cl ^
-DCMAKE_CXX_COMPILER=clang-cl ^
-DENABLE_XHOST=!ENABLE_XHOST! ^
-DMAX_AM_ERI=!MAX_AM_ERI! ^
$(Build.SourcesDirectory)
displayName: "Configure Psi4"
workingDirectory: $(Build.BinariesDirectory)
# Build
- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
cmake --build . ^
--config %CMAKE_BUILD_TYPE% ^
-- -j %NUMBER_OF_PROCESSORS%
displayName: "Build Psi4"
workingDirectory: $(Build.BinariesDirectory)/build
# Install
- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
cmake --build . ^
--config %CMAKE_BUILD_TYPE% ^
--target install ^
-- -j %NUMBER_OF_PROCESSORS%
displayName: "Install Psi4"
workingDirectory: $(Build.BinariesDirectory)/build
# Test (OpenMP)
# Check if OpenMP configuration had not failed silently
- script: |
python -c "from psi4 import core; core.set_num_threads(42); assert core.get_num_threads() == 42"
displayName: "Test Psi4 (OpenMP)"
workingDirectory: $(Build.BinariesDirectory)/install/lib
# Test (ctest)
- script: |
setlocal EnableDelayedExpansion
if "%CTEST_TYPE%"=="full" set CTEST_TYPE=".*"
ctest --build-config %CMAKE_BUILD_TYPE% ^
--label-regex !CTEST_TYPE! ^
--output-on-failure ^
--parallel %NUMBER_OF_PROCESSORS% ^
--timeout 3000
displayName: "Test Psi4 (ctest $(ctest.type))"
workingDirectory: $(Build.BinariesDirectory)/build
# Test (pytest)
- script: |
set PATH=$(Build.BinariesDirectory)\install\bin;%PATH%
set PYTHONPATH=$(Build.BinariesDirectory)\install\lib;%PYTHONPATH%
psi4 --test %PYTEST_TYPE%
displayName: "Test Psi4 (pytest $(pytest.type))"
workingDirectory: $(Build.BinariesDirectory)
# Build package
- script: |
set INSTALL_DIR=$(Build.BinariesDirectory)\install
conda build --python %PYTHON_VERSION% ^
conda\win
copy /y C:\tools\miniconda3\conda-bld\win-64\psi4-*.bz2 $(Build.ArtifactStagingDirectory)
condition: and(succeeded(), eq(variables['conda.build'], 'true'))
displayName: "Build Psi4 package"
# Publish package
- task: PublishBuildArtifacts@1
inputs:
artifactName: conda
condition: and(succeeded(), eq(variables['conda.build'], 'true'))
displayName: "Publish Psi4 package"