This repository has been archived by the owner on Jan 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 268
/
azure-pipelines.yml
205 lines (199 loc) · 6.91 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
trigger:
- test-azure
- master
- release/*
jobs:
# Linux
- job: Linux
strategy:
matrix:
py36:
python_version: "3.6"
py37:
python_version: "3.7"
py38:
python_version: "3.8"
pool:
vmImage: "ubuntu-18.04"
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python_version)"
- bash: |
pip install setuptools
pip install -r requirements-frozen.txt
python setup.py sdist
displayName: "Build tar.gz with python $(python_version)"
- bash: |
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz
pyinstaller nrfutil.spec
displayName: "Build executable with python $(python_version)"
- bash: |
python setup.py test
displayName: "Regression tests for python $(python_version)"
- bash: |
dist/nrfutil keys generate key-test.txt
dist/nrfutil keys display --key pk --format code key-test.txt
displayName: "Smoke test for python $(python_version)"
- bash: |
mv dist/nrfutil dist/nrfutil-linux
cp -R dist/nrfutil-linux "$(Build.ArtifactStagingDirectory)"
condition: eq(variables['python_version'], '3.7')
displayName: "Copy artifacts"
- task: GitHubRelease@0
inputs:
gitHubConnection: "waylandCI"
repositoryName: "NordicSemiconductor/pc-nrfutil"
action: "edit"
tagSource: "Git tag"
tag: "$(Build.SourceBranchName)"
assetUploadMode: "replace"
isDraft: "true"
addChangeLog: "false"
condition: ne(variables['Build.Reason'], 'PullRequest')
# macOS
- job: macOS
strategy:
matrix:
py36:
python_version: '3.6.8'
python_bin: '3.6'
py37:
python_version: '3.7.5'
python_bin: '3.7'
py38:
python_version: '3.8.0'
python_bin: '3.8'
pool:
vmImage: "macos-10.15"
steps:
- bash: |
wget https://www.python.org/ftp/python/$(python_version)/python-$(python_version)-macosx10.9.pkg
sudo installer -pkg python-$(python_version)-macosx10.9.pkg -target /
displayName: 'Install python $(python_version)'
- bash: |
pypath=`which python$(python_bin)`
${pypath} -m pip install setuptools
${pypath} -m pip install -r requirements-frozen.txt
${pypath} setup.py sdist
displayName: "Build tar.gz with python $(python_version)"
- bash: |
pypath=`which python$(python_bin)`
${pypath} -m pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz
export PATH=/Library/Frameworks/Python.framework/Versions/$(python_bin)/bin:$PATH
pyinstaller nrfutil.spec
displayName: "Build executable with python $(python_version)"
- bash: |
pypath=`which python$(python_bin)`
${pypath} setup.py test
displayName: "Regression tests for python $(python_version)"
- bash: |
dist/nrfutil keys generate key-test.txt
dist/nrfutil keys display --key pk --format code key-test.txt
displayName: "Smoke test for python $(python_version)"
- bash: |
mv dist/nrfutil dist/nrfutil-mac
cp -R dist/nrfutil-mac "$(Build.ArtifactStagingDirectory)"
condition: eq(variables['python_version'], '3.7.5')
displayName: "Copy artifacts"
- task: GitHubRelease@0
inputs:
gitHubConnection: "waylandCI"
repositoryName: "NordicSemiconductor/pc-nrfutil"
action: "edit"
tagSource: "Git tag"
tag: "$(Build.SourceBranchName)"
assetUploadMode: "replace"
isDraft: "true"
addChangeLog: "false"
condition: ne(variables['Build.Reason'], 'PullRequest')
# Windows
- job: Windows
strategy:
matrix:
py36_win32:
python_version: "3.6"
python_arch: "x86"
py36_win64:
python_version: "3.6"
python_arch: "x64"
py37_win32:
python_version: "3.7"
python_arch: "x86"
py37_win64:
python_version: "3.7"
python_arch: "x64"
py38_win32:
python_version: "3.8"
python_arch: "x86"
py38_win64:
python_version: "3.8"
python_arch: "x64"
pool:
vmImage: "vs2017-win2016"
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python_version)"
architecture: "$(python_arch)"
- bash: |
pip install -r requirements-frozen.txt
pip install --upgrade setuptools==42.0.0
pip install wheel
python setup.py sdist
displayName: "Build tar.gz with python $(python_version)"
- bash: |
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz
pyinstaller nrfutil.spec
displayName: "Build exe with python $(python_version)"
- bash: |
python setup.py test
displayName: "Regression tests for python $(python_version)"
- bash: |
dist/nrfutil keys generate key-test.txt
dist/nrfutil keys display --key pk --format code key-test.txt
displayName: "Smoke test for python $(python_version)"
- bash: |
cp -R dist/*.tar.gz "$(Build.ArtifactStagingDirectory)"
cp -R dist/*.exe "$(Build.ArtifactStagingDirectory)"
condition: and(eq(variables['python_arch'], 'x64'), eq(variables['python_version'], '3.7'))
displayName: "Copy artifacts"
- task: GitHubRelease@0
inputs:
gitHubConnection: "waylandCI"
repositoryName: "NordicSemiconductor/pc-nrfutil"
action: "edit"
tagSource: "Git tag"
tag: "$(Build.SourceBranchName)"
assetUploadMode: "replace"
isDraft: "true"
addChangeLog: "false"
condition: ne(variables['Build.Reason'], 'PullRequest')
#
- job: TriggerTest
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: 'Trigger test (check test result on Jenkins)'
inputs:
connectionType: 'connectedServiceName'
serviceConnection: 'waylandJenkins'
method: 'POST'
urlSuffix: 'view/pc-nrfutil/job/pc-nrfutil-$(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: 'false'
condition: ne(variables['Build.Reason'], 'PullRequest')