forked from NordicSemiconductor/pc-ble-driver-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
166 lines (163 loc) · 5.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
trigger:
- feature/s132v5_py3
- test-azure
- master
- release/*
jobs:
# Linux
- job: Linux
variables:
wheel_platform: 'manylinux2010_x86_64'
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: Docker@2
displayName: 'Build ManyLinux wheel'
inputs:
containerRegistry: acr-nrfprivateeu
command: run
arguments: '--rm -e PLAT=$(wheel_platform) -v $(System.DefaultWorkingDirectory):/data nrfprivateeu.azurecr.io/nrf/projects-pc-ble-driver-py-linux:v2 /build/build-wheels.sh'
- bash: |
ls -R wheelhouse
cp --verbose -R wheelhouse/*.whl "$(Build.ArtifactStagingDirectory)"
displayName: 'Copy wheels'
- task: GitHubRelease@0
inputs:
gitHubConnection: 'waylandCI'
repositoryName: 'NordicSemiconductor/pc-ble-driver-py'
action: 'edit'
tagSource: 'Git tag'
tag: '$(Build.SourceBranchName)'
assetUploadMode: 'replace'
isDraft: 'true'
addChangeLog: 'false'
condition: ne(variables['Build.Reason'], 'PullRequest')
# macOS
- job: macOS
variables:
VCPKG_ROOT: '$(Agent.HomeDirectory)/vcpkg'
python_arch: 'x64'
pool:
vmImage: 'macos-10.13'
steps:
- script: |
ls /Applications
sudo xcode-select -s /Applications/Xcode_10.1.app
displayName: 'Install XCode'
- script: |
brew install swig gcc@6
displayName: 'Install gcc and swig'
- script: |
git clone https://github.com/NordicPlayground/vcpkg.git $(VCPKG_ROOT)
CC=gcc-6 CXX=g++-6 $(VCPKG_ROOT)/bootstrap-vcpkg.sh
displayName: 'Install vcpkg'
- script: |
export PATH=$VCPKG_ROOT:$PATH
export VCPKG_OSX_DEPLOYMENT_TARGET=10.9
vcpkg install nrf-ble-driver:$(python_arch)-osx
displayName: 'Install nrf-ble-driver'
- bash: |
wget https://www.python.org/ftp/python/3.7.3/python-3.7.3-macosx10.9.pkg
sudo installer -pkg python-3.7.3-macosx10.9.pkg -target /
displayName: 'Install all pythons'
- bash: |
rm -rf _skbuild
pypath=`which python3.7`
${pypath} -m pip install -r requirements-dev.txt
${pypath} setup.py bdist_wheel --build-type Release -- -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
displayName: 'Build for python 3.7'
- bash: |
cp -R dist/*.whl "$(Build.ArtifactStagingDirectory)"
displayName: 'Copy artifacts'
- task: GitHubRelease@0
inputs:
gitHubConnection: 'waylandCI'
repositoryName: 'NordicSemiconductor/pc-ble-driver-py'
action: 'edit'
tagSource: 'Git tag'
tag: '$(Build.SourceBranchName)'
assetUploadMode: 'replace'
isDraft: 'true'
addChangeLog: 'false'
condition: ne(variables['Build.Reason'], 'PullRequest')
# Windows
- job: Windows
variables:
VCPKG_ROOT: '$(Agent.HomeDirectory)\vcpkg'
strategy:
matrix:
win64:
python_arch: 'x64'
generator: 'Visual Studio 15 2017 Win64'
win32:
python_arch: 'x86'
generator: 'Visual Studio 15 2017'
pool:
vmImage: 'vs2017-win2016'
steps:
- script: |
choco install -y --x86 swig
displayName: 'Install toolchain on Windows'
- script: |
git clone https://github.com/NordicPlayground/vcpkg.git $(VCPKG_ROOT)
$(VCPKG_ROOT)\bootstrap-vcpkg.bat
displayName: 'Install vcpkg'
- script: |
set PATH=$(VCPKG_ROOT);%PATH%
vcpkg install nrf-ble-driver:$(python_arch)-windows
displayName: 'Install nrf-ble-driver'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: '$(python_arch)'
- bash: |
rm -rf _skbuild
pypath=`which python`
pyroot=`dirname ${pypath}`
pyheader=`ls ${pyroot}/include/Python.h`
pyincldir=`dirname ${pyheader}`
pylib=`ls ${pyroot}/libs/python37.lib`
pip install -r requirements-dev.txt
python setup.py bdist_wheel --build-type RelWithDebInfo -- -DPYTHON_INCLUDE_DIR=${pyincldir} -DPYTHON_LIBRARY=${pylib} -G "$(generator)"
displayName: 'Build for python 3.7'
- bash: |
cp -R dist/*.whl "$(Build.ArtifactStagingDirectory)"
displayName: 'Copy artifacts'
- task: GitHubRelease@0
inputs:
gitHubConnection: 'waylandCI'
repositoryName: 'NordicSemiconductor/pc-ble-driver-py'
action: 'edit'
tagSource: 'Git tag'
tag: '$(Build.SourceBranchName)'
assetUploadMode: 'replace'
isDraft: 'true'
addChangeLog: 'false'
condition: ne(variables['Build.Reason'], 'PullRequest')
- job: Test
dependsOn: [
Windows,
Linux,
macOS,
]
strategy:
matrix:
linux:
osType: 'linux'
mac:
osType: 'mac'
win64:
osType: 'win64'
win32:
osType: 'win32'
pool: server
steps:
- task: InvokeRESTAPI@1
displayName: Test
inputs:
connectionType: 'connectedServiceName'
serviceConnection: 'waylandJenkins'
method: 'POST'
urlSuffix: 'view/pc-ble-driver-py/job/pc-ble-driver-py-$(osType)/buildWithParameters?BRANCH=$(Build.SourceBranch)&VSTS_URL=$(system.CollectionUri)&TOKEN=$(system.AccessToken)&PROJECT_ID=$(system.teamProjectId)&HUB_NAME=$(system.hostType)&PLAN_ID=$(system.planId)&TASK_ID=$(system.taskInstanceId)&JOB_ID=$(system.jobId)'
waitForCompletion: 'true'
condition: ne(variables['Build.Reason'], 'PullRequest')