-
Notifications
You must be signed in to change notification settings - Fork 9
/
.azure-pipelines.yml
164 lines (148 loc) · 4.72 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
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
trigger:
batch: true
branches:
include:
- '*'
tags:
include:
- v*
variables:
python.arch: 'x64'
upload_coverage: false
deploy: false
schedules:
- cron: "0 0 * * 0"
displayName: Weekly Sunday build
branches:
include:
- master
always: true
strategy:
matrix:
linux-python36:
imageName: 'ubuntu-latest'
python.version: '3.6'
linux-python37:
imageName: 'ubuntu-latest'
python.version: '3.7'
linux-python38:
imageName: 'ubuntu-latest'
python.version: '3.8'
upload_coverage: true
mac-python38:
imageName: 'macOS-latest'
python.version: '3.8'
upload_coverage: true
windows-x86-python36:
imageName: 'windows-latest'
python.version: '3.6'
python.arch: 'x86'
windows-x86-python37:
imageName: 'windows-latest'
python.version: '3.7'
python.arch: 'x86'
windows-x86-python38:
imageName: 'windows-latest'
python.version: '3.8'
python.arch: 'x86'
upload_coverage: true
windows-x64-python36:
imageName: 'windows-latest'
python.version: '3.6'
windows-x64-python37:
imageName: 'windows-latest'
python.version: '3.7'
windows-x64-python38:
imageName: 'windows-latest'
python.version: '3.8'
upload_coverage: true
deploy: true
maxParallel: 10
pool:
vmImage: $(imageName)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(python.version)
architecture: $(python.arch)
addToPath: true
displayName: Use Python $(python.version) $(python.arch)
# Install missing libraries on Linux
- bash: |
sudo apt-get install -y xvfb libdbus-1-3 libxkbcommon-x11-0
echo "##vso[task.setvariable variable=QT_QPA_PLATFORM]offscreen"
condition: eq(variables['Agent.OS'], 'Linux')
displayName: Install missing libraries required for Qt on Linux
# Install dependencies and PRISM
- bash: |
python -m pip install --upgrade pip setuptools wheel
if [[ $BUILD_SOURCEBRANCH == refs/heads/* ]] && [[ $BUILD_SOURCEBRANCH != "refs/heads/master" ]]; then
git clone -b dev https://github.com/1313e/e13Tools ../e13Tools
cd ../e13Tools
pip install .
cd -
fi
pip install -r requirements_dev.txt
displayName: Install testing dependencies
# Test deployability
- script: |
check-manifest
python setup.py sdist bdist_wheel
twine check dist/*
python -c "import prism; prism.get_info()"
displayName: Test deployability
# Test package in serial
- script: |
coverage run --rcfile=setup.cfg -m pytest
displayName: Test package in serial
# Install MPI
# Linux
- bash: |
sudo apt-get install -y -q openmpi-bin libopenmpi-dev
condition: eq(variables['Agent.OS'], 'Linux')
displayName: Install MPI distribution on Linux
# Mac OS-X
- bash: |
brew install openmpi
condition: eq(variables['Agent.OS'], 'Darwin')
displayName: Install MPI distribution on Mac OS-X
# Windows
- powershell: |
iwr -outf ..\MSMpiSDK.msi https://download.microsoft.com/download/A/E/0/AE002626-9D9D-448D-8197-1EA510E297CE/MSMpiSDK.msi
Start-Process ..\MSMpiSDK.msi -ArgumentList "/quiet /qn" -Wait
iwr -outf ..\MSMpiSetup.exe https://download.microsoft.com/download/A/E/0/AE002626-9D9D-448D-8197-1EA510E297CE/MSMpiSetup.exe
Start-Process ..\MSMpiSetup.exe -ArgumentList "-unattend -force -verbose" -Wait
echo "##vso[task.setvariable variable=MSMPI_BIN]C:\Program Files\Microsoft MPI\Bin"
echo "##vso[task.setvariable variable=Path]$Env:Path;C:\Program Files\Microsoft MPI\Bin"
condition: eq(variables['Agent.OS'], 'Windows_NT')
displayName: Install MPI distribution on Windows
# Install mpi4py
- script: |
pip install --no-cache-dir mpi4py
displayName: Install mpi4py
# Test package in MPI
- script: |
mpiexec -n 2 coverage run --rcfile=setup.cfg -m mpi4py -m pytest
displayName: Test package in MPI
# Report coverage
- script: |
coverage combine
coverage report -m
displayName: Coverage report
# Upload covarage report to CodeCov
- bash: |
curl -s https://codecov.io/bash | bash
condition: and(succeeded(), eq(variables['upload_coverage'], true))
displayName: Upload coverage report if requested
# Deploy on PyPI if this is a release
- script: |
twine upload --skip-existing dist/*
env:
TWINE_USERNAME: '1313e'
TWINE_PASSWORD: $(twine_password)
condition: and(succeeded(), eq(variables['deploy'], true), startsWith(variables['build.sourceBranch'], 'refs/tags/'))
displayName: Deploy on PyPI if this is a release