-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
68 lines (61 loc) · 2.84 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
language: cpp
compiler: gcc
addons:
sonarcloud:
organization: "crustyauklet"
token:
secure: "8786c9af96075a5daef2f05e6b6518f2146496aa" # encrypted value of your token
# the install step will take care of deploying a newer cmake version
install:
# URL and Names as variables
- ARM_URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2"
- ARM_NAME="gcc-arm-none-eabi-8-2019-q3-update"
- CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v3.15.3/cmake-3.15.3-Linux-x86_64.tar.gz"
- CMAKE_NAME="cmake-3.15.3-Linux-x86_64"
# first we create a directory for the CMake binaries
- DEPS_DIR="${HOME}/deps"
- mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
# we use wget to fetch the cmake binaries
- travis_retry wget --no-check-certificate ${CMAKE_URL}
# this is optional, but useful:
# do a quick md5 check to ensure that the archive we downloaded did not get compromised
#- echo "f3546812c11ce7f5d64dc132a566b749 *cmake-3.3.2-Linux-x86_64.tar.gz" > cmake_md5.txt
#- md5sum -c cmake_md5.txt
# extract the binaries; the output here is quite lengthy,
# so we swallow it to not clutter up the travis console
- tar -xvf ${CMAKE_NAME}.tar.gz > /dev/null
- mv ${CMAKE_NAME} cmake-install
# add both the top-level directory and the bin directory from the archive
# to the system PATH. By adding it to the front of the path we hide the
# preinstalled CMake with our own.
- PATH=${DEPS_DIR}/cmake-install:${DEPS_DIR}/cmake-install/bin:$PATH
# Download the ARM GCC Embedded Toolchain
- travis_retry wget --no-check-certificate $ARM_URL -O gcc-arm-none-eabi.tar.bz2
# Unzip the ARM GCC Embedded Toolchain
- tar -xvjf gcc-arm-none-eabi.tar.bz2 > /dev/null
# Export path to ARM GCC binaries
- export PATH=${DEPS_DIR}/${ARM_NAME}/bin/:$PATH
# don't forget to switch back to the main build directory once you are done
- cd ${TRAVIS_BUILD_DIR}
before_script:
- cmake --version && arm-none-eabi-g++ -v && arm-none-eabi-gcc -v
# create a build folder for the out-of-source build
- mkdir build
# switch to build directory
- cd build
# run cmake; here we assume that the project's
# top-level CMakeLists.txt is located at '..'
- cmake .. -DCMAKE_TOOLCHAIN_FILE=../seal-device/toolchain/cortex-m0plus.cmake
script:
- make clean
# Wraps the compilation with the Build Wrapper to generate configuration (used
# later by the SonarQube Scanner) into the "bw-output" folder
- build-wrapper-linux-x86-64 --out-dir ../bw-output make all
# once CMake has done its job we just build using make as usual
- make
# if the project uses ctest we can run the tests like this
# - make test
# And finally run the SonarQube analysis - read the "sonar-project.properties"
# file to see the specific configuration
- cd ..
- sonar-scanner -Dsonar.verbose=true -X