@@ -48,244 +48,6 @@ addons:
4848matrix :
4949 include :
5050
51- # ## Basic Tests ###
52- - &basic-vm
53- stage : " Basic"
54- name : " file attributes"
55- env : NAME=gitattributestest
56- script :
57- - git diff --exit-code
58-
59- - << : *basic-vm
60- name : " license check"
61- env : NAME=licence_check
62- language : python
63- python : 3.6.8 # scancode-toolkit v3.1.1 requires v3.6.8
64- install :
65- # workaround for https://github.com/ARMmbed/mbed-os/issues/13322
66- - pip install pdfminer.six==20200517
67- - pip install scancode-toolkit==3.1.1
68- before_script :
69- - mkdir -p SCANCODE
70- - mkdir -p SCANCODE_NEW_FILES
71- # Fetch the base branch to compare against
72- - git fetch origin "${TRAVIS_BRANCH}" --depth=1
73- script :
74- # scancode does not support list of files, only one file or directory
75- # we use SCANCODE directory for all changed files (their copies with full tree)
76- - >-
77- git diff --name-only --diff-filter=ad FETCH_HEAD..HEAD \
78- | ( grep '.\(c\|cpp\|h\|hpp\|py\)$' || true ) \
79- | ( grep -v '^tools/test/toolchains/api_test.py' || true ) \
80- | while read file; do cp --parents "${file}" SCANCODE; done
81- - scancode -l --json-pp scancode.json SCANCODE
82- - python ./tools/test/travis-ci/scancode-evaluate.py scancode.json || true
83- # run the same but for new files. All new files must have SPDX
84- - >-
85- git diff --name-only --diff-filter=A FETCH_HEAD..HEAD \
86- | ( grep '.\(c\|cpp\|h\|hpp\|py\)$' || true ) \
87- | ( grep -v '^tools/test/toolchains/api_test.py' || true ) \
88- | while read file; do cp --parents "${file}" SCANCODE_NEW_FILES; done
89- - scancode -l --json-pp scancode_new_files.json SCANCODE_NEW_FILES
90- - python ./tools/test/travis-ci/scancode-evaluate.py scancode_new_files.json || true
91- - cat scancode-evaluate.log
92- - COUNT=$(cat scancode-evaluate.log | grep 'File:' | grep -v 'SPDX' | wc -l) || true
93- - python ./tools/test/travis-ci/scancode-evaluate.py scancode_new_files.json
94- - cat scancode-evaluate.log
95- - COUNT_NEW_FILES=$(cat scancode-evaluate.log | grep 'File:' | grep -v 'SPDX' | wc -l) || true
96- - |
97- if [ $COUNT == 0 ] && [ $COUNT_NEW_FILES == 0 ]; then
98- echo "License check OK";
99- true;
100- elif [ $COUNT_NEW_FILES != 0 ]; then
101- echo "License check failed, new files with the license issues found";
102- false;
103- else
104- echo "License check failed, please review license issues found in modified files";
105- false;
106- fi
107-
108- - << : *basic-vm
109- name : " UTF-8 Check"
110- script :
111- # Make sure we're not introducing any text which is not UTF-8 encoded
112- - git diff $TRAVIS_BRANCH...HEAD -U0 | ( grep -a '^+' || true ) | ( ! grep -axv '.*' )
113-
114- - << : *basic-vm
115- name : " include check"
116- env : NAME=include_check
117- script :
118- - |
119- ! git grep '^#include\s["'"']mbed.h['"'"]$' -- '*.c' '*.h' '*.cpp' '*.hpp' \
120- ':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' \
121- ':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*' \
122- ':!*events/tests/*' ':!*drivers/tests/*'
123-
124- # ## Docs Tests ###
125- - &docs-vm
126- stage : " Docs"
127- name : " astyle"
128- env : NAME=astyle
129- install :
130- - >-
131- curl -L0 https://mbed-os-ci-public.s3-eu-west-1.amazonaws.com/jenkins-ci/deps/astyle_3.1_linux.tar.gz --output astyle.tar.gz;
132- mkdir -p BUILD && tar xf astyle.tar.gz -C BUILD;
133- cd BUILD/astyle/build/gcc;
134- make;
135- export PATH="${PWD}/bin:${PATH}";
136- cd -
137- - astyle --version
138- # Fetch the base branch to compare against
139- - git fetch origin "${TRAVIS_BRANCH}" --depth=1
140- script :
141- - >-
142- git diff --name-only --diff-filter=d FETCH_HEAD..HEAD \
143- | ( grep '.*\.\(c\|cpp\|h\|hpp\)$' || true ) \
144- | ( grep -v -f .codecheckignore || true ) \
145- | while read file; do astyle -n --options=.astylerc "${file}"; done
146- - git diff --exit-code --diff-filter=d --color
147-
148- - << : *docs-vm
149- name : " spellcheck"
150- env : NAME=doxy-spellcheck
151- install :
152- - source_pkg aspell
153- script :
154- # TODO: run checks on all directories once all mispellings are fixed
155- - ./tools/test/travis-ci/doxy-spellchecker/spell.sh drivers .codecheckignore
156- - ./tools/test/travis-ci/doxy-spellchecker/spell.sh platform .codecheckignore
157- - ./tools/test/travis-ci/doxy-spellchecker/spell.sh events .codecheckignore
158- - ./tools/test/travis-ci/doxy-spellchecker/spell.sh rtos .codecheckignore
159- - ./tools/test/travis-ci/doxy-spellchecker/spell.sh connectivity/netsocket .codecheckignore
160-
161- - << : *docs-vm
162- name : " doxygen"
163- env : NAME=docs
164- install :
165- # Build doxygen
166- - >
167- (git clone --depth=1 --single-branch --branch Release_1_8_14 https://github.com/doxygen/doxygen;
168- cd doxygen;
169- mkdir build;
170- cd build;
171- cmake -G "Unix Makefiles" ..;
172- make;
173- sudo make install)
174- # Create BUILD directory for tests
175- - ccache -s
176- - mkdir BUILD
177- script :
178- # Assert that the Doxygen build produced no warnings.
179- # The strange command below asserts that the Doxygen command had an
180- # output of zero length
181- - doxygen doxyfile_options 2>&1
182- # Once Mbed OS has been fixed, enable the full test by replacing the top line with this:
183- # - ( ! doxygen doxyfile_options 2>&1 | grep . )
184- # Assert that all binary libraries are named correctly
185- # The strange command below asserts that there are exactly 0 libraries
186- # that do not start with lib
187- - >
188- find "(" -name "*.a" -or -name "*.ar" ")" -and -not -name "lib*" |
189- tee BUILD/badlibs |
190- sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ]
191- # Assert that all assembler files are named correctly
192- # The strange command below asserts that there are exactly 0 libraries
193- # that do end with .s
194- - >
195- find -name "*.s" | tee BUILD/badasm |
196- sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]
197-
198- # ## Python Tests ###
199- - &pytools-vm
200- stage : " Pytest"
201- name : " tools-py35"
202- env : NAME=tools-py3.5
203- language : python
204- python : 3.7
205- install :
206- # Install gcc
207- - source_pkg gcc
208- - arm-none-eabi-gcc --version
209- # Install additional python modules
210- - python --version
211- - |-
212- tr -d ' ' >> requirements.txt <<< "
213- mock==2.0.0
214- attrs==19.1.0
215- pytest==3.3.0
216- pylint>=1.9,<2
217- hypothesis>=3,<4
218- coverage>=4.5,<5
219- "
220- - pip install --upgrade pip
221- - pip install -r requirements.txt
222- - pip list --verbose
223- script :
224- # Run local testing on tools
225- - PYTHONPATH=. coverage run -a -m pytest tools/test
226- - python tools/test/pylint.py
227- - coverage run -a tools/project.py -S | sed -n '/^Total/p'
228- - coverage html
229-
230- - &extended-vm
231- stage : " Pin validation"
232- name : " pinvalidate"
233- env : NAME=pinvalidate
234- language : python
235- python : 3.7
236- install :
237- # Install python modules
238- - pip install --upgrade pip
239- - pip install tabulate argparse
240- - pip list --verbose
241- # Fetch the base branch to compare against
242- - git fetch origin "${TRAVIS_BRANCH}" --depth=1
243- script :
244- - >-
245- git diff --name-only --diff-filter=d FETCH_HEAD..HEAD \
246- | ( grep '.*[\\|\/]PinNames.h$' || true ) \
247- | while read file; do python ./hal/tests/pinvalidate/pinvalidate.py -vvvfp "${file}"; done
248- - git diff --exit-code --diff-filter=d --color
249-
250- # ## CMake Check ###
251- - &cmake-vm
252- stage : " CMake Check"
253- name : " Backward compatiblity check - MBED_TEST_MODE"
254- env : NAME=mbed-test-mode-check ROOT=tools/cmake/tests/mbed_test_mode/ TOOLCHAIN=GCC_ARM TARGET_NAME=K64F PROFILE=develop
255- language : python
256- python : 3.8
257- install :
258- # Hide Travis-preinstalled CMake
259- # The Travis-preinstalled CMake is unfortunately not installed via apt, so we
260- # can't replace it with an apt-supplied version very easily. Additionally, we
261- # can't permit the Travis-preinstalled copy to survive, as the Travis default
262- # path lists the Travis CMake install location ahead of any place where apt
263- # would install CMake to. Instead of apt removing or upgrading to a new CMake
264- # version, we must instead delete the Travis copy of CMake.
265- - sudo rm -rf /usr/local/cmake*
266- # Setup ccache
267- - ccache -o compiler_check=content
268- - ccache -M 1G
269- - pushd /usr/lib/ccache
270- - sudo ln -s ../../bin/ccache arm-none-eabi-gcc
271- - sudo ln -s ../../bin/ccache arm-none-eabi-g++
272- - export PATH="/usr/lib/ccache:$PATH"
273- - popd
274- # Install arm-none-eabi-gcc
275- - pushd /home/travis/build && mkdir arm-gcc && cd arm-gcc
276- - curl -L0 "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2?revision=05382cca-1721-44e1-ae19-1e7c3dc96118&la=en&hash=D7C9D18FCA2DD9F894FD9F3C3DC9228498FA281A" --output gcc-arm-none-eabi-9-2020-q2-update.tar.bz2
277- - tar xf gcc-arm-none-eabi-9-2020-q2-update.tar.bz2
278- - export PATH="$PATH:${PWD}/gcc-arm-none-eabi-9-2020-q2-update/bin"
279- - popd
280- - arm-none-eabi-gcc --version
281- # Install python modules
282- - pip install --upgrade mbed-tools
283- - pip install -r tools/cmake/requirements.txt
284- script :
285- - mbedtools configure -p ${ROOT} -t ${TOOLCHAIN} -m ${TARGET_NAME} --mbed-os-path .
286- - cmake -S ${ROOT} -B ${ROOT}/cmake_build/${TARGET_NAME}/${PROFILE}/${TOOLCHAIN}/ -GNinja -DCMAKE_BUILD_TYPE=${PROFILE}
287- - cmake --build ${ROOT}/cmake_build/${TARGET_NAME}/${PROFILE}/${TOOLCHAIN}/
288-
28951 # ## Mbed OS unittest ###
29052 - &cmake-build-run-unittest
29153 stage : " CMake"
@@ -306,36 +68,6 @@ matrix:
30668 - gcovr --gcov-executable gcov-7 -r . ./build -s -e ".*\.h" --exclude-directories=$TRAVIS_BUILD_DIR/build/UNITTESTS --exclude-directories=$TRAVIS_BUILD_DIR/build/_deps
30769 - ccache -s
30870
309- # ## Frozen tools check ###
310- - &frozen-tools-vm
311- stage : " Frozen tools check"
312- name : " Frozen tools check"
313- env : NAME=frozen_tools_check
314- before_script :
315- # Fetch the base branch to compare against
316- - git fetch origin "${TRAVIS_BRANCH}" --depth=1
317- script :
318- # Reject any changes to tools that would require a re-release of the
319- # tools for the online compiler.
320- - >-
321- frozen_files=`\
322- git diff --name-only FETCH_HEAD..HEAD \
323- | egrep \
324- -e "^tools/build_api*" \
325- -e "^tools/config*" \
326- -e "^tools/export*" \
327- -e "^tools/notifier*" \
328- -e "^tools/paths*" \
329- -e "^tools/resources*" \
330- -e "^tools/targets*" \
331- -e "^tools/toolchains*" \
332- -e "^tools/utils*" \
333- -e "^$"`
334- if [ -z "$frozen_files" ]; then
335- echo "Success!";
336- else
337- echo -e "Failure: Frozen files were modified\n$frozen_files";
338- echo -e "Please see https://os.mbed.com/blog/entry/Introducing-the-new-Mbed-Tools/" \
339- "\nfor why we've frozen the legacy tools.";
340- false;
341- fi
71+ language : c
72+ after_success :
73+ - bash <(curl -s https://codecov.io/bash) -t 57166f89-22b3-4949-9488-ddd3c78123fb
0 commit comments