Skip to content

Commit f51723c

Browse files
committed
CMake: Add Travis script to run a basic CI check for PRs
1 parent e89879c commit f51723c

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

104136
### Docs Tests ###
105137
- &docs-vm

0 commit comments

Comments
 (0)