CMake: Add Travis script to run a basic CI check for PRs

pull/13566/head
Hugues Kamba 2020-07-20 18:29:13 +01:00
parent 53d712849a
commit 5709dd2752
1 changed files with 32 additions and 0 deletions

View File

@ -34,6 +34,10 @@ cache:
before_install: before_install:
- source tools/test/travis-ci/functions.sh - source tools/test/travis-ci/functions.sh
addons:
apt:
packages:
- ninja-build
matrix: matrix:
include: include:
@ -106,6 +110,34 @@ matrix:
':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*' \ ':!*tests/*' ':!*targets/*' ':!*TARGET_*' ':!*unsupported/*' \
':!*events/tests/*' ':!*drivers/tests/*' ':!*events/tests/*' ':!*drivers/tests/*'
- &cmake-build-test
stage: "CMake"
name: "CMake blinky example"
env: NAME=cmake_test
language: python
python: 3.8
install:
# Install gcc
- source_pkg gcc
- arm-none-eabi-gcc --version
- pip install --upgrade cmake
- pip install --upgrade mbed-tools
# We use manual clone, with depth and single branch = the fastest
# Because of this, we need to create .mbed file as the current tools require it
- >-
git clone --depth=1 --single-branch --branch feature-cmake https://github.com/ARMmbed/mbed-os-example-blinky.git;
cd mbed-os-example-blinky;
git clone --depth=1 --single-branch https://github.com/ARMmbed/mbed-os.git;
cd mbed-os;
git fetch origin +refs/pull/${TRAVIS_PULL_REQUEST}/merge;
git checkout -qf FETCH_HEAD
- >-
cd -;
touch .mbed;
mbedtools configure -t GCC_ARM -m K64F;
mkdir -p build
script:
- cd build && cmake .. -GNinja -DMBED_PROFILE=develop && cmake --build .
### Docs Tests ### ### Docs Tests ###
- &docs-vm - &docs-vm