forked from pulkin/micropython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
481 lines (386 loc) · 15.8 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
variables:
GITHUB_OAUTH_CONNECTION_NAME: 'github-pulkin'
GITHUB_MICROPY_REPO: 'pulkin/micropython'
GITHUB_RELEASE_TAG: 'latest-build'
MAKEOPTS: "-j4"
stages:
- stage: build
displayName: 'Test and build'
jobs:
- job: port_stm32
displayName: 'stm32 port build'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: git submodule update --init lib/lwip lib/mbedtls lib/stm32lib
displayName: 'Checkout submodules'
- script: |
sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
sudo apt-get update -qq || true
sudo apt-get install gcc-arm-embedded
sudo apt-get install libnewlib-arm-none-eabi
arm-none-eabi-gcc --version
displayName: 'Install dependencies'
- script: |
make $(MAKEOPTS) -C mpy-cross
make $(MAKEOPTS) -C ports/stm32
make $(MAKEOPTS) -C ports/stm32 BOARD=PYBV11 MICROPY_PY_WIZNET5K=5200 MICROPY_PY_CC3K=1
make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF2
make ${MAKEOPTS} -C ports/stm32 BOARD=STM32F769DISC CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1'
make $(MAKEOPTS) -C ports/stm32 BOARD=STM32L476DISC
make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBD_SF6
displayName: 'Build'
- job: port_qemu_arm
displayName: 'qemu-arm port build and tests'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: |
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi
sudo apt-get install libnewlib-arm-none-eabi
sudo apt-get install qemu-system
arm-none-eabi-gcc --version
qemu-system-arm --version
displayName: 'Install dependencies'
- script: |
make $(MAKEOPTS) -C mpy-cross
make $(MAKEOPTS) -C ports/qemu-arm -f Makefile.test test
displayName: 'Build'
- job: test_unix
displayName: 'unix coverage build and tests'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
submodules: recursive
- script: git submodule update --init lib/axtls lib/berkeley-db-1.xx lib/libffi
displayName: 'Checkout submodules'
- script: |
sudo pip install cpp-coveralls
gcc --version
python3 --version
displayName: 'Install dependencies'
- script: |
make $(MAKEOPTS) -C mpy-cross
make $(MAKEOPTS) -C ports/unix deplibs
make $(MAKEOPTS) -C ports/unix coverage
# run the main test suite
(cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests)
(cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -d thread)
(cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --emit native)
(cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy -d basics float micropython)
(cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy --emit native -d basics float micropython)
# test when input script comes from stdin
cat tests/basics/0prelim.py | ports/unix/micropython_coverage | grep -q 'abc'
# run coveralls coverage analysis (try to, even if some builds/tests failed)
# (cd ports/unix && coveralls --root ../.. --build-root . --gcov $(which gcov) --gcov-options '\-o build-coverage/' --include py --include extmod)
displayName: 'Test'
- job: port_unix
displayName: 'unix port build and tests'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: git submodule update --init lib/axtls lib/berkeley-db-1.xx lib/libffi
displayName: 'Checkout submodules'
- script: |
make $(MAKEOPTS) -C mpy-cross
make $(MAKEOPTS) -C ports/unix deplibs
make $(MAKEOPTS) -C ports/unix
make $(MAKEOPTS) -C ports/unix test
(cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython ./run-perfbench.py 1000 1000)
displayName: 'Build'
- task: PublishPipelineArtifact@1
displayName: 'Collect the build'
inputs:
targetPath: '$(Build.Repository.LocalPath)/ports/unix/micropython'
artifact: 'build_unix'
- job: port_unix_nanbox
displayName: 'unix nanbox port build and tests'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: git submodule update --init lib/axtls lib/berkeley-db-1.xx lib/libffi
displayName: 'Checkout submodules'
- script: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install gcc-multilib libffi-dev:i386
displayName: 'Install dependencies'
- script: |
make $(MAKEOPTS) -C mpy-cross
make $(MAKEOPTS) -C ports/unix deplibs
make $(MAKEOPTS) -C ports/unix nanbox
(cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_nanbox ./run-tests)
displayName: 'Build'
- job: port_unix_stackless
displayName: 'unix stackless port build and tests with clang'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: git submodule update --init lib/axtls lib/berkeley-db-1.xx lib/libffi
displayName: 'Checkout submodules'
- script: |
sudo apt-get install clang
displayName: 'Install dependencies'
- script: |
make ${MAKEOPTS} -C mpy-cross CC=clang
make ${MAKEOPTS} -C ports/unix CC=clang CFLAGS_EXTRA="-DMICROPY_STACKLESS=1 -DMICROPY_STACKLESS_STRICT=1"
make ${MAKEOPTS} -C ports/unix CC=clang test
displayName: 'Build'
- job: port_unix_systrace
displayName: 'unix port with sys.settrace build and tests'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: |
make ${MAKEOPTS} -C mpy-cross
make ${MAKEOPTS} -C ports/unix MICROPY_PY_BTREE=0 MICROPY_PY_FFI=0 MICROPY_PY_USSL=0 CFLAGS_EXTRA="-DMICROPY_PY_SYS_SETTRACE=1" test
make ${MAKEOPTS} -C ports/unix clean
make ${MAKEOPTS} -C ports/unix MICROPY_PY_BTREE=0 MICROPY_PY_FFI=0 MICROPY_PY_USSL=0 CFLAGS_EXTRA="-DMICROPY_STACKLESS=1 -DMICROPY_STACKLESS_STRICT=1 -DMICROPY_PY_SYS_SETTRACE=1" test
displayName: 'Build'
- job: port_mingw
displayName: 'windows port build via mingw'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: |
sudo apt-get install gcc-mingw-w64
displayName: 'Install dependencies'
- script: |
make $(MAKEOPTS) -C mpy-cross
make $(MAKEOPTS) -C ports/windows CROSS_COMPILE=i686-w64-mingw32-
displayName: 'Build'
- job: port_esp32_idfv3
displayName: 'esp32 port build IDF v3'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: git submodule update --init lib/berkeley-db-1.xx
displayName: 'Checkout submodules'
- script: |
sudo apt-get install python-pip python3-pip
sudo pip3 install 'pyparsing<2.4'
sudo pip install pyserial
wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
zcat xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz | tar x
git clone https://github.com/espressif/esp-idf.git
git -C esp-idf checkout $(grep "ESPIDF_SUPHASH_V3 :=" ports/esp32/Makefile | cut -d " " -f 3)
git -C esp-idf submodule update --init components/json/cJSON components/esp32/lib components/esptool_py/esptool components/expat/expat components/lwip/lwip components/mbedtls/mbedtls components/micro-ecc/micro-ecc components/nghttp/nghttp2
displayName: 'Install dependencies and toolchain'
- script: |
export PATH=$(pwd)/xtensa-esp32-elf/bin:$PATH
export IDF_PATH=$(pwd)/esp-idf
make ${MAKEOPTS} -C mpy-cross
make ${MAKEOPTS} -C ports/esp32 ESPIDF=$(pwd)/esp-idf
displayName: 'Build'
- job: port_esp32_idfv4
displayName: 'esp32 port build IDF v4'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: git submodule update --init lib/berkeley-db-1.xx
displayName: 'Checkout submodules'
- script: |
sudo apt-get install python-pip python3-pip
sudo pip3 install 'pyparsing<2.4'
sudo pip install pyserial
wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
zcat xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz | tar x
git clone https://github.com/espressif/esp-idf.git
git -C esp-idf checkout $(grep "ESPIDF_SUPHASH_V4 :=" ports/esp32/Makefile | cut -d " " -f 3)
git -C esp-idf submodule update --init components/esp_wifi/lib_esp32 components/esptool_py/esptool components/lwip/lwip components/mbedtls/mbedtls
displayName: 'Install dependencies and toolchain'
- script: |
export PATH=$(pwd)/xtensa-esp32-elf/bin:$PATH
export IDF_PATH=$(pwd)/esp-idf
make ${MAKEOPTS} -C mpy-cross
make ${MAKEOPTS} -C ports/esp32 ESPIDF=$(pwd)/esp-idf
displayName: 'Build'
- job: port_esp8266
displayName: 'esp8266 port build'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: git submodule update --init lib/axtls lib/berkeley-db-1.xx
displayName: 'Checkout submodules'
- script: |
sudo apt-get install python-pip python3-pip
sudo pip3 install pyparsing
sudo pip install pyserial
wget https://github.com/jepler/esp-open-sdk/releases/download/2018-06-10/xtensa-lx106-elf-standalone.tar.gz
zcat xtensa-lx106-elf-standalone.tar.gz | tar x
displayName: 'Install dependencies and toolchain'
- script: |
export PATH=$(pwd)/xtensa-lx106-elf/bin:$PATH
make ${MAKEOPTS} -C mpy-cross
make ${MAKEOPTS} -C ports/esp8266
displayName: 'Build'
- script: |
cd ports/esp8266/build
find . \! -name '*.bin' -delete
cd -
displayName: 'Cleanup build before publishing'
- task: PublishPipelineArtifact@1
displayName: 'Collect the build'
inputs:
targetPath: '$(Build.Repository.LocalPath)/ports/esp8266/build'
artifact: 'build_esp8266'
- job: port_nrf
displayName: 'nrf port build'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: git submodule update --init lib/nrfx
displayName: 'Checkout submodules'
- script: |
sudo apt-get install gcc-arm-none-eabi
sudo apt-get install libnewlib-arm-none-eabi
arm-none-eabi-gcc --version
displayName: 'Install dependencies'
- script: |
make ${MAKEOPTS} -C ports/nrf
displayName: 'Build'
- job: port_bare_arm
displayName: 'bare-arm and minimal ports build'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: |
sudo apt-get install gcc-arm-none-eabi
sudo apt-get install libnewlib-arm-none-eabi
arm-none-eabi-gcc --version
displayName: 'Install dependencies'
- script: |
make ${MAKEOPTS} -C ports/bare-arm
make ${MAKEOPTS} -C ports/minimal CROSS=1 build/firmware.bin
ls -l ports/minimal/build/firmware.bin
tools/check_code_size.sh
displayName: 'Build'
- job: port_cc3200
displayName: 'cc3200 port build'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: |
sudo apt-get install gcc-arm-none-eabi
sudo apt-get install libnewlib-arm-none-eabi
displayName: 'Install dependencies'
- script: |
make ${MAKEOPTS} -C ports/cc3200 BTARGET=application BTYPE=release
make ${MAKEOPTS} -C ports/cc3200 BTARGET=bootloader BTYPE=release
displayName: 'Build'
- job: port_samd
displayName: 'samd port build'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: git submodule update --init lib/asf4 lib/tinyusb
displayName: 'Checkout submodules'
- script: |
sudo apt-get install gcc-arm-none-eabi
sudo apt-get install libnewlib-arm-none-eabi
displayName: 'Install dependencies'
- script: |
make ${MAKEOPTS} -C ports/samd
displayName: 'Build'
- job: port_teensy
displayName: 'teensy port build'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: |
sudo apt-get install gcc-arm-none-eabi
sudo apt-get install libnewlib-arm-none-eabi
displayName: 'Install dependencies'
- script: |
make ${MAKEOPTS} -C ports/teensy
displayName: 'Build'
- job: port_gprs_a9
displayName: 'gprs_a9 build'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: git submodule update --init --recursive lib/axtls lib/GPRS_C_SDK lib/csdtk42-linux
displayName: 'Checkout submodules'
- script: |
sudo apt-get update
sudo apt-get install build-essential gcc-multilib g++-multilib libzip-dev zlib1g lib32z1
displayName: 'Install dependencies'
- script: |
make ${MAKEOPTS} -C mpy-cross
cd ports/gprs_a9
make
displayName: 'Build'
- task: PublishPipelineArtifact@1
displayName: 'Collect the build'
inputs:
targetPath: '$(Build.Repository.LocalPath)/ports/gprs_a9/hex'
artifact: 'build_gprs_a9'
- stage: publish
displayName: 'Publish builds'
dependsOn: build
jobs:
- job: publish
displayName: 'Download and publish builds'
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download all builds'
inputs:
buildType: 'current'
targetPath: '$(Build.BinariesDirectory)'
- script: |
mv $(Build.BinariesDirectory)/build_gprs_a9/*.lod $(Build.BinariesDirectory)
rm -rf $(Build.BinariesDirectory)/build_gprs_a9
mv $(Build.BinariesDirectory)/build_esp8266/*.bin $(Build.BinariesDirectory)
rm -rf $(Build.BinariesDirectory)/build_esp8266
mv $(Build.BinariesDirectory)/build_unix/micropython $(Build.BinariesDirectory)
rm -rf $(Build.BinariesDirectory)/build_unix
displayName: 'Sort and filter binaries'
- task: GitHubRelease@0
displayName: 'Publish on Github releases'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
gitHubConnection: $(GITHUB_OAUTH_CONNECTION_NAME)
repositoryName: $(GITHUB_MICROPY_REPO)
action: 'edit'
target: '$(Build.SourceVersion)'
tag: $(GITHUB_RELEASE_TAG)
title: 'Latest master build'
releaseNotesSource: 'input'
releaseNotes: |
The latest successful `master` build.
Updated: $(Year:yy)-$(Month)-$(DayOfMonth) $(Hours):$(Minutes):$(Seconds)
Firmware files
--------------
- **unix**
- [micropython](https://github.com/$(GITHUB_MICROPY_REPO)/releases/download/$(GITHUB_RELEASE_TAG)/micropython)
- **gprs_a9**
Burn instructions: use [cooltools](https://ai-thinker-open.github.io/GPRS_C_SDK_DOC/en/c-sdk/burn-debug.html)
Firmware files:
- [firmware_debug_full.lod](https://github.com/$(GITHUB_MICROPY_REPO)/releases/download/$(GITHUB_RELEASE_TAG)/firmware_debug_full.lod)
- [firmware_debug_flash.lod](https://github.com/$(GITHUB_MICROPY_REPO)/releases/download/$(GITHUB_RELEASE_TAG)/firmware_debug_flash.lod)
- **esp8266**
Burn instructions: use [esptool](https://github.com/espressif/esptool)
Firmware files:
- [firmware_combined.bin](https://github.com/$(GITHUB_MICROPY_REPO)/releases/download/$(GITHUB_RELEASE_TAG)/firmware-combined.bin)
assets: '$(Build.BinariesDirectory)/*'
assetUploadMode: 'replace'
isPreRelease: true
addChangeLog: false