Skip to content

Commit d69b2ef

Browse files
Refactor installation step in the cmakecheck job
The Travis-preinstalled CMake is unfortunately not installed via apt, so we can't replace it with an apt-supplied version very easily. Additionally, we can't permit the Travis-preinstalled copy to survive, as the Travis default path lists the Travis CMake install location ahead of any place where apt would install CMake to. Instead of apt removing or upgrading to a new CMake version, we must instead delete the Travis copy of CMake and install a newer version via apt.
1 parent 33ebdc4 commit d69b2ef

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.travis.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ before_install:
3535

3636
addons:
3737
apt:
38+
sources:
39+
- sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial main'
40+
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
41+
- sourceline: 'deb https://apt.kitware.com/ubuntu/ xenial-rc main'
3842
packages:
39-
- ninja-build
43+
- cmake
44+
- ninja-build
4045

4146
matrix:
4247
include:
@@ -109,7 +114,7 @@ matrix:
109114
':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*' \
110115
':!*events/tests/*' ':!*drivers/tests/*'
111116
112-
### Docs Tests ###
117+
### Docs Tests ###
113118
- &docs-vm
114119
stage: "Docs"
115120
name: "astyle"
@@ -270,6 +275,14 @@ matrix:
270275
language: python
271276
python: 3.7
272277
install:
278+
# Hide Travis-preinstalled CMake
279+
# The Travis-preinstalled CMake is unfortunately not installed via apt, so we
280+
# can't replace it with an apt-supplied version very easily. Additionally, we
281+
# can't permit the Travis-preinstalled copy to survive, as the Travis default
282+
# path lists the Travis CMake install location ahead of any place where apt
283+
# would install CMake to. Instead of apt removing or upgrading to a new CMake
284+
# version, we must instead delete the Travis copy of CMake.
285+
- sudo rm -rf /usr/local/cmake*
273286
# Install gcc
274287
- source_pkg gcc
275288
- arm-none-eabi-gcc --version
@@ -346,7 +359,11 @@ matrix:
346359
stage: "Extended"
347360
name: "cmakecheck"
348361
env: NAME=cmakecheck
362+
language: python
363+
python: 3.8
349364
install:
365+
# Hide Travis-preinstalled CMake
366+
- sudo rm -rf /usr/local/cmake*
350367
# Install python modules
351368
- python -m pip install --upgrade pip==18.1
352369
- python -m pip install --upgrade setuptools==40.4.3
@@ -355,6 +372,6 @@ matrix:
355372
script:
356373
# Validate MBED_TEST_MODE backward compatibility
357374
- mbedtools configure -p tools/cmake/tests/mbed_test_mode -t GCC_ARM -m K64F --mbed-os-path .
358-
- cmake -S tools/cmake/tests/mbed_test_mode -B tools/cmake/tests/mbed_test_mode/cmake_build/K64F/develop/GCC_ARM/ -GNinja -DCMAKE_BUILD_TYPE=develop
375+
- cmake -S tools/cmake/tests/mbed_test_mode/ -B tools/cmake/tests/mbed_test_mode/cmake_build/K64F/develop/GCC_ARM/ -GNinja -DCMAKE_BUILD_TYPE=develop
359376
- cmake --build tools/cmake/tests/mbed_test_mode/cmake_build/K64F/develop/GCC_ARM/
360377

0 commit comments

Comments
 (0)