-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathazure-pipelines.yml
140 lines (121 loc) · 4.27 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
# Pipelines are made of one or more jobs and may include resources and variables.
# Jobs are made of one or more steps plus some job-specific data. Steps can be
# tasks, scripts, or references to external templates.
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
strategy:
maxParallel: 2
# matrix:
# py36:
# PY_VERSION: 3.6
# py37:
# PY_VERSION: 3.7
variables:
repoDir: '$(Build.Repository.LocalPath)'
steps:
# NOTE: On Linux, there is no write permission in the miniconda installation,
# and the CondaEnvironment@1 does not honor a prefix. Therefore we can *not*
# use the conda that comes with Azure as we do on Windows. This is also
# documented in the following issue: https://github.com/Microsoft/vsts-tasks/issues/8299
# Therefore we need to create our own conda environment from scratch.
- task: CondaEnvironment@1
inputs:
updateConda: false
- script: |
conda config --set always_yes yes --set changeps1 no || exit 1
conda update -q conda || exit 1
conda env create -f cpptools-dev-requirements.yml || exit 1
source activate cpptools-dev-requirements || exit 1
mkdir build || exit 1
cd build || exit 1
cmake .. || exit 1
make -j2 || exit 1
make cpp-test || exit 1
make python-test || exit 1
echo "run cpp example" || exit 1
cd examples || exit 1
./hello_world || exit 1
cd .. || exit 1
echo "run cpp benchmark" || exit 1
cd benchmark || exit 1
./benchmark_cpptools || exit 1
cd .. || exit 1
echo "Completed script successfully" || exit 1
- job: macOS
pool:
vmImage: 'xcode9-macos10.13'
strategy:
maxParallel: 2
# matrix:
# py36:
# PY_VERSION: 3.6
# py37:
# PY_VERSION: 3.7
variables:
repoDir: '$(Build.Repository.LocalPath)'
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- script: |
conda config --set always_yes yes --set changeps1 no || exit 1
conda env create -f cpptools-dev-requirements.yml || exit 1
echo "source conda env" || exit 1
source activate cpptools-dev-requirements || exit 1
mkdir build || exit 1
cd build || exit 1
echo "cmake" || exit 1
cmake .. || exit 1
echo "make" || exit 1
make -j2 || exit 1
make python-test || exit 1
echo "Completed script successfully" || exit 1
- job:
displayName: vs2017-win2016
pool:
vmImage: 'vs2017-win2016'
strategy:
maxParallel: 2
# matrix:
# py36:
# PY_VERSION: 3.6
# VS_VERSION: 2015
# # py27:
# # PY_VERSION: 2.7
variables:
repoDir: '$(Build.Repository.LocalPath)'
steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH
- script: |
echo "create"
conda env create -f cpptools-dev-requirements.yml
echo "done"
displayName: create dev requirements env
- script: |
echo "activate" || exit 1
call activate cpptools-dev-requirements || exit 1
echo "mkdir" || exit 1
mkdir build || exit 1
cd build || exit 1
echo "cmake gen" || exit 1
cmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release ^
-DDEPENDENCY_SEARCH_PREFIX="%CONDA_PREFIX%\Library" -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" || exit 1
displayName: configure project
- script: |
echo "cd path"
cd build
echo "activate"
call activate cpptools-dev-requirements
cmake --build . --target ALL_BUILD
displayName: build project
- script: |
echo "cd path" || exit 1
cd build || exit 1
echo "activate" || exit 1
call activate cpptools-dev-requirements || exit 1
echo "run tests" || exit 1
cmake --build . --target python-test || exit 1
cmake --build . --target cpp-test || exit 1
displayName: run tests