forked from NordicSemiconductor/pc-nrfutil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
176 lines (171 loc) · 5.99 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
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-16.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.13"
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')