forked from pfalcon/pycopy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
288 lines (268 loc) · 11.6 KB
/
.travis.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
# global options
dist: xenial
language:
- c
compiler:
- gcc
cache:
directories:
- "${HOME}/persist"
env:
global:
- MAKEOPTS="-j4"
- XTENSA_CROSS_ROOT="${HOME}/persist/toolchain-xtensa"
- XTENSA_CROSS_BINDIR="${XTENSA_CROSS_ROOT}/bin"
git:
submodules: false
addons:
apt:
packages:
- make
- unrar
- autoconf
- automake
- libtool
- libtool-bin
- gcc
- g++
- gperf
- flex
- bison
- texinfo
- gawk
- libncurses5-dev
- libexpat1-dev
- python
- sed
- help2man
- libmbedtls-dev
# define the successive stages
stages:
- name: test
# define the jobs for the stages
# order of the jobs has longest running first to optimise total time
jobs:
include:
# esp8266 port
- stage: test
env: NAME="esp8266 port build"
install:
- export HAS_XTENSA="test -d ${XTENSA_CROSS_BINDIR}"
- unset CC # Travis sets this due to "language: c", but it confuses autotools configure when cross-building
- ${HAS_XTENSA} || git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
- ${HAS_XTENSA} || cd esp-open-sdk
- ${HAS_XTENSA} || sed -r -i 's%TOOLCHAIN ?=.*%TOOLCHAIN=${XTENSA_CROSS_ROOT}%' Makefile
- ${HAS_XTENSA} || make
script:
- cd ${TRAVIS_BUILD_DIR}
- git submodule update --init lib/axtls lib/berkeley-db-1.xx
- make ${MAKEOPTS} -C mpy-cross
- PATH=${XTENSA_CROSS_BINDIR}:${PATH} make -C ports/esp8266
# stm32 port
- stage: test
env: NAME="stm32 port build"
install:
# need newer gcc version for Cortex-M7 support
- 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
script:
- git submodule update --init lib/lwip lib/mbedtls lib/stm32lib
- make ${MAKEOPTS} -C mpy-cross
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_F091RC
- 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=NUCLEO_H743ZI CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1'
- make ${MAKEOPTS} -C ports/stm32 BOARD=B_L072Z_LRWAN1
- make ${MAKEOPTS} -C ports/stm32 BOARD=STM32L476DISC
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_WB55
- make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBD_SF6
# qemu-arm port
- stage: test
env: NAME="qemu-arm port build and tests"
install:
- 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
script:
- make ${MAKEOPTS} -C mpy-cross
- make ${MAKEOPTS} -C ports/qemu-arm -f Makefile.test test || true
after_failure:
- grep "FAIL" ports/qemu-arm/build/console.out
# unix coverage
- stage: test
env: NAME="unix coverage build and tests"
install:
- sudo pip install cpp-coveralls
- gcc --version
- python3 --version
script:
- git submodule update --init lib/axtls lib/berkeley-db-1.xx lib/libffi
- 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/pycopy_coverage ./run-tests)
- (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/pycopy_coverage ./run-tests -d thread)
- (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/pycopy_coverage ./run-tests --emit native)
- (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/pycopy_coverage ./run-tests --via-mpy -d basics float micropython)
- (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/pycopy_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/pycopy_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)
after_failure:
- (cd tests && for exp in *.exp; do testbase=$(basename $exp .exp); echo -e "\nFAILURE $testbase"; diff -u $testbase.exp $testbase.out; done)
# standard unix port
- stage: test
env: NAME="unix port build and tests"
script:
- git submodule update --init lib/axtls lib/berkeley-db-1.xx lib/libffi
- 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/pycopy ./run-perfbench.py 1000 1000)
# unix port with mbedTLS
- stage: test
env: NAME="unix port with mbedTLS build and tests"
script:
- git submodule update --init lib/mbedtls lib/berkeley-db-1.xx lib/libffi
- make ${MAKEOPTS} -C mpy-cross
- make ${MAKEOPTS} -C ports/unix MICROPY_SSL_MBEDTLS=1 MICROPY_SSL_AXTLS=0
- make ${MAKEOPTS} -C ports/unix MICROPY_SSL_MBEDTLS=1 MICROPY_SSL_AXTLS=0 test RUN_TESTS_EXTRA="-e ussl_basic"
# micropython-dev unix port
- stage: test
env: NAME="unix port micropython-dev"
script:
- git submodule update --init lib/axtls lib/berkeley-db-1.xx lib/libffi
- make ${MAKEOPTS} -C mpy-cross
- make ${MAKEOPTS} -C ports/unix dev
- make ${MAKEOPTS} -C ports/unix dev_test
# unix nanbox
- stage: test
env: NAME="unix nanbox port build and tests"
install:
- sudo apt-get install gcc-multilib libffi-dev:i386
script:
- git submodule update --init lib/axtls lib/berkeley-db-1.xx lib/libffi
- 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/pycopy_nanbox ./run-tests)
# unix stackless
- stage: test
env: NAME="unix stackless port build and tests"
script:
- git submodule update --init lib/axtls lib/berkeley-db-1.xx lib/libffi
- make ${MAKEOPTS} -C mpy-cross
- make ${MAKEOPTS} -C ports/unix deplibs
- make ${MAKEOPTS} -C ports/unix CFLAGS_EXTRA="-DMICROPY_STACKLESS=1 -DMICROPY_STACKLESS_STRICT=1"
- make ${MAKEOPTS} -C ports/unix test
# unix port with clang
- stage: test
env: NAME="unix port with clang"
script:
- git submodule update --init lib/axtls lib/berkeley-db-1.xx lib/libffi
- make ${MAKEOPTS} CC=clang -C mpy-cross
- make ${MAKEOPTS} CC=clang -C ports/unix
- make ${MAKEOPTS} CC=clang -C ports/unix test
# unix with sys.settrace
- stage: test
env: NAME="unix port with sys.settrace build and tests"
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
after_failure:
- (cd tests && for exp in *.exp; do testbase=$(basename $exp .exp); echo -e "\nFAILURE $testbase"; diff -u $testbase.exp $testbase.out; done)
# windows port via mingw
- stage: test
env: NAME="windows port build via mingw"
install:
- sudo apt-get install gcc-mingw-w64
script:
- make ${MAKEOPTS} -C mpy-cross
- make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=i686-w64-mingw32-
# esp32 port
- stage: test
env: NAME="esp32 port build"
install:
- sudo apt-get install python3-pip
- sudo pip3 install 'pyparsing<2.4'
- 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
- export PATH=$(pwd)/xtensa-esp32-elf/bin:$PATH
- git clone https://github.com/espressif/esp-idf.git
- export IDF_PATH=$(pwd)/esp-idf
script:
- git submodule update --init lib/berkeley-db-1.xx
- make ${MAKEOPTS} -C mpy-cross
# IDF v3 build
- 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
- make ${MAKEOPTS} -C ports/esp32
# clean
- git -C esp-idf clean -f -f -d components/json/cJSON components/esp32/lib components/expat/expat components/micro-ecc/micro-ecc components/nghttp/nghttp2
- make ${MAKEOPTS} -C ports/esp32 clean
# IDF v4 build
- 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
- make ${MAKEOPTS} -C ports/esp32
# nrf port
- stage: test
env: NAME="nrf port build"
install:
- sudo apt-get install gcc-arm-none-eabi
- sudo apt-get install libnewlib-arm-none-eabi
- arm-none-eabi-gcc --version
script:
- git submodule update --init lib/nrfx
- make ${MAKEOPTS} -C ports/nrf
# bare-arm and minimal ports
- stage: test
env: NAME="bare-arm and minimal ports build"
install:
- sudo apt-get install gcc-arm-none-eabi
- sudo apt-get install libnewlib-arm-none-eabi
- arm-none-eabi-gcc --version
script:
- make ${MAKEOPTS} -C mpy-cross
- 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
- mkdir -p ${HOME}/persist
# Save new firmware for reference, but only if building a main branch, not a pull request
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cp ports/minimal/build/firmware.bin ${HOME}/persist/; fi'
# cc3200 port
- stage: test
env: NAME="cc3200 port build"
install:
- sudo apt-get install gcc-arm-none-eabi
- sudo apt-get install libnewlib-arm-none-eabi
script:
- make ${MAKEOPTS} -C ports/cc3200 BTARGET=application BTYPE=release
- make ${MAKEOPTS} -C ports/cc3200 BTARGET=bootloader BTYPE=release
# samd port
- stage: test
env: NAME="samd port build"
install:
- sudo apt-get install gcc-arm-none-eabi
- sudo apt-get install libnewlib-arm-none-eabi
script:
- git submodule update --init lib/asf4 lib/tinyusb
- make ${MAKEOPTS} -C ports/samd
# teensy port
- stage: test
env: NAME="teensy port build"
install:
- sudo apt-get install gcc-arm-none-eabi
- sudo apt-get install libnewlib-arm-none-eabi
script:
- make ${MAKEOPTS} -C ports/teensy