@@ -35,7 +35,11 @@ before_install:
3535
3636addons :
3737 apt :
38+ sources :
39+ - sourceline : ' deb https://apt.kitware.com/ubuntu/ focal main'
40+ key_url : ' https://apt.kitware.com/keys/kitware-archive-latest.asc'
3841 packages :
42+ - cmake
3943 - ninja-build
4044 - libncursesw5
4145
@@ -279,3 +283,41 @@ matrix:
279283 | while read file; do python ./hal/tests/pinvalidate/pinvalidate.py -vfp "${file}"; done
280284 - git diff --exit-code --diff-filter=d --color
281285
286+ # ## CMake Check ###
287+ - &cmake-vm
288+ stage : " CMake Check"
289+ name : " Backward compatiblity check - MBED_TEST_MODE"
290+ env : NAME=mbed-test-mode-check ROOT=tools/cmake/tests/mbed_test_mode/ TOOLCHAIN=GCC_ARM TARGET_NAME=K64F PROFILE=develop
291+ language : python
292+ python : 3.8
293+ install :
294+ # Hide Travis-preinstalled CMake
295+ # The Travis-preinstalled CMake is unfortunately not installed via apt, so we
296+ # can't replace it with an apt-supplied version very easily. Additionally, we
297+ # can't permit the Travis-preinstalled copy to survive, as the Travis default
298+ # path lists the Travis CMake install location ahead of any place where apt
299+ # would install CMake to. Instead of apt removing or upgrading to a new CMake
300+ # version, we must instead delete the Travis copy of CMake.
301+ - sudo rm -rf /usr/local/cmake*
302+ # Setup ccache
303+ - ccache -o compiler_check=content
304+ - ccache -M 1G
305+ - pushd /usr/lib/ccache
306+ - sudo ln -s ../../bin/ccache arm-none-eabi-gcc
307+ - sudo ln -s ../../bin/ccache arm-none-eabi-g++
308+ - export PATH="/usr/lib/ccache:$PATH"
309+ - popd
310+ # Install arm-none-eabi-gcc
311+ - pushd /home/travis/build && mkdir arm-gcc && cd arm-gcc
312+ - 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
313+ - tar xf gcc-arm-none-eabi-9-2020-q2-update.tar.bz2
314+ - export PATH="$PATH:${PWD}/gcc-arm-none-eabi-9-2020-q2-update/bin"
315+ - popd
316+ - arm-none-eabi-gcc --version
317+ # Install python modules
318+ - pip install --upgrade mbed-tools
319+ - pip install -r tools/cmake/requirements.txt
320+ script :
321+ - mbedtools configure -p ${ROOT} -t ${TOOLCHAIN} -m ${TARGET_NAME} --mbed-os-path .
322+ - cmake -S ${ROOT} -B ${ROOT}/cmake_build/${TARGET_NAME}/${PROFILE}/${TOOLCHAIN}/ -GNinja -DCMAKE_BUILD_TYPE=${PROFILE}
323+ - cmake --build ${ROOT}/cmake_build/${TARGET_NAME}/${PROFILE}/${TOOLCHAIN}/
0 commit comments