-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathazure-pipelines.yml
128 lines (125 loc) · 4.66 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
jobs:
- job: 'BuildPython'
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python35:
python.version: '3.5'
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
maxParallel: 3
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: conda create --yes --quiet --name testenv python=$(python.version)
displayName: Create Anaconda environment
- bash: |
source activate testenv
conda install --yes --quiet --name testenv pybind11 scipy
python -m pip install cpplint
python -m pip install -r requirements.txt
displayName: Install Python packages
- script: |
source activate testenv
python -m pip install flake8
flake8 .
displayName: Run lint tests
- bash: |
source activate testenv
export CENTROIDS_DEBUG_OUTPUT=1
export CENTROIDS_VERBOSE_BUILD=1
python setup.py install
displayName: 'Build and Install Python Code'
- bash: |
source activate testenv
pip install pytest
pip install pytest-cov
pytest --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml
displayName: 'Test with pytest'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
- job: 'BuildLib'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
architecture: 'x64'
- script: |
sudo apt-get install cmake
python -m pip install cpplint
displayName: Install Deps
- script: |
mkdir build
cd build
cmake -DBUILD_PYTHON=NO -DBUILD_DOCS=NO ..
make
displayName: Build and Install
- job: 'BuildDocs'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DownloadSecureFile@1
inputs:
secureFile: deploy_key
displayName: 'Get the deploy key'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
architecture: 'x64'
- script: |
python -m pip install sphinx sphinx-bootstrap-theme breathe
npm install --prefix=${HOME} gh-pages
sudo apt-get install flex bison cmake graphviz
git config user.email "[email protected]"
git config user.name "ci-build"
displayName: Install Deps
- script: |
export DOXYGEN_VER=1.8.15
export DOXYGEN_TAR=${DOXYGEN_VER}.linux.bin.tar.gz
export DOXYGEN_URL="https://downloads.sourceforge.net/project/doxygen/rel-${DOXYGEN_VER}/doxygen-${DOXYGEN_VER}.src.tar.gz"
export TMP_DIR=${TMPDIR-/tmp}
export INSTALL_DIR=${TMP_DIR}/doxygen
wget -O - "${DOXYGEN_URL}" | tar xzf - -C ${TMP_DIR}
cd ${TMP_DIR}/doxygen-${DOXYGEN_VER}
mkdir build && cd build
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} ..
make
make install
displayName: Build and Install Doxygen
- bash: |
mkdir builddir
cd builddir
cmake -DBUILD_DOCS=ON -DCPPLINT_CHECK=OFF \
-DBUILD_PYTHON=OFF \
-DBUILD_LIB=OFF \
-DDOXYGEN_EXECUTABLE=/tmp/doxygen/bin/doxygen \
..
make docs
displayName: Build Docs using CMake
- script: |
set -x
mkdir ~/.ssh && mv $DOWNLOADSECUREFILE_SECUREFILEPATH ~/.ssh/id_rsa
chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
# sudo mkdir /usr/local/lib/node_modules/gh-pages/.cache
# sudo chmod 777 /usr/local/lib/node_modules/gh-pages/.cache
${HOME}/node_modules/.bin/gh-pages [email protected]:NSLS-II/centroids.git --dotfiles=true --dist builddir/docs/build
displayName: Publish to GitHub Pages
condition: |
not(eq(variables['Build.Reason'], 'PullRequest'))