Skip to content

Commit ade9959

Browse files
hugueskamba0xc0170
authored andcommitted
CMake: Add Travis script to run a basic CI check for PRs
1 parent cdbd455 commit ade9959

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.travis.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ after_success:
4040
after_failure:
4141
- set_status "failure" "Test failed."
4242

43+
addons:
44+
apt:
45+
packages:
46+
- ninja-build
4347

4448
matrix:
4549
include:
@@ -102,6 +106,34 @@ matrix:
102106
':!*platform_mbed.h' ':!*TESTS/*' ':!TEST_APPS/' ':!UNITTESTS/' \
103107
':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*'
104108
109+
- &cmake-build-test
110+
stage: "CMake"
111+
name: "CMake blinky example"
112+
env: NAME=cmake_test
113+
language: python
114+
python: 3.8
115+
install:
116+
# Install gcc
117+
- source_pkg gcc
118+
- arm-none-eabi-gcc --version
119+
- pip install --upgrade cmake
120+
- pip install --upgrade mbed-tools
121+
# We use manual clone, with depth and single branch = the fastest
122+
# Because of this, we need to create .mbed file as the current tools require it
123+
- >-
124+
git clone --depth=1 --single-branch --branch feature-cmake https://github.com/ARMmbed/mbed-os-example-blinky.git;
125+
cd mbed-os-example-blinky;
126+
git clone --depth=1 --single-branch https://github.com/ARMmbed/mbed-os.git;
127+
cd mbed-os;
128+
git fetch origin +refs/pull/${TRAVIS_PULL_REQUEST}/merge;
129+
git checkout -qf FETCH_HEAD
130+
- >-
131+
cd -;
132+
touch .mbed;
133+
mbedtools configure -t GCC_ARM -m K64F;
134+
mkdir -p build
135+
script:
136+
- cd build && cmake .. -GNinja -DMBED_PROFILE=develop && cmake --build .
105137

106138
### Docs Tests ###
107139
- &docs-vm

0 commit comments

Comments
 (0)