travis: improve build process and expand build matrix

Make a build heriarchy to reduce images size.
Add Android Things builds to build matrix.
Drop gcc-4 builds, use gcc-5 and gcc-6 instead.
Add SonarQube static analysis scans.

Signed-off-by: Nicolas Oliver <dario.n.oliver@intel.com>
This commit is contained in:
Nicolas Oliver
2017-07-10 07:28:18 -07:00
parent 98811b0fb7
commit ab4eeea61e
14 changed files with 722 additions and 168 deletions

View File

@ -2,70 +2,112 @@ version: '2.1'
services:
main:
base:
image: upm-base
build:
context: .
dockerfile: Dockerfile
dockerfile: docker/Dockerfile.base
args:
- http_proxy
- https_proxy
- no_proxy
- BUILDDOC=${BUILDDOC:-OFF}
- BUILDCPP=${BUILDCPP:-ON}
- BUILDFTI=${BUILDFTI:-ON}
- BUILDSWIGPYTHON=${BUILDSWIGPYTHON:-OFF}
- BUILDSWIGJAVA=${BUILDSWIGJAVA:-OFF}
- BUILDSWIGNODE=${BUILDSWIGNODE:-OFF}
- BUILDEXAMPLES=${BUILDEXAMPLE:-ON}
- IPK=${IPK:-OFF}
- RPM=${RPM:-OFF}
- NPM=${NPM:-OFF}
- BUILDTESTS=${BUILDTESTS:-ON}
- CC=${CC:-clang-3.8}
- CXX=${CXX:-clang++-3.8}
- NODE_VERSION=${NODE_VERSION:-v4.4.7}
- WERROR=${WERROR:-ON}
environment:
- http_proxy
- https_proxy
- no_proxy
- BUILDDOC=${BUILDDOC:-OFF}
- BUILDCPP=${BUILDCPP:-ON}
- BUILDFTI=${BUILDFTI:-ON}
- BUILDSWIGPYTHON=${BUILDSWIGPYTHON:-OFF}
- BUILDSWIGJAVA=${BUILDSWIGJAVA:-OFF}
- BUILDSWIGNODE=${BUILDSWIGNODE:-OFF}
- BUILDEXAMPLES=${BUILDEXAMPLE:-ON}
- IPK=${IPK:-OFF}
- RPM=${RPM:-OFF}
- NPM=${NPM:-OFF}
- BUILDTESTS=${BUILDTESTS:-ON}
- CC=${CC:-clang-3.8}
- CXX=${CXX:-clang++-3.8}
- NODE_VERSION=${NODE_VERSION:-v4.4.7}
- WERROR=${WERROR:-ON}
volumes:
- .:${UPM_SRC_DIR:-/usr/src/app}
doc:
extends: main
extends: base
environment:
- BUILDDOC=ON
command: bash -c "./scripts/run-cmake.sh && make -j8 -Cbuild doc"
sonar-scan:
extends: base
image: upm-sonar
build:
dockerfile: docker/Dockerfile.sonar
args:
- BUILDDOC=ON
command: bash -c "make -j8 doc"
- NODE_VERSION=v5.12.0
environment:
- BUILDSWIGPYTHON=ON
- BUILDSWIGNODE=ON
- BUILDSWIGJAVA=ON
- SONAR_TOKEN
- SONAR_ORG
- SONAR_PROJ_KEY
- TRAVIS_BRANCH
- TRAVIS_PULL_REQUEST
- TRAVIS_REPO_SLUG
- TRAVIS_PULL_REQUEST_SLUG
- GITHUB_TOKEN
command: bash -c "./scripts/run-cmake.sh && cd build && ../scripts/sonar-scan.sh"
python:
extends: main
extends: base
image: upm-python
build:
args:
- BUILDSWIGPYTHON=ON
command: bash -c "make -j8 && make -j8 install && ldconfig && ctest --output-on-failure"
dockerfile: docker/Dockerfile.python
environment:
- BUILDSWIGPYTHON=ON
command: bash -c "./scripts/run-cmake.sh && cd build && make -j8 && make -j8 install && ldconfig && ctest --output-on-failure"
java:
extends: main
extends: base
image: upm-java
build:
args:
- BUILDSWIGJAVA=ON
command: bash -c "make -j8 && make -j8 install && ldconfig && ctest --output-on-failure"
dockerfile: docker/Dockerfile.java
environment:
- BUILDSWIGJAVA=ON
command: bash -c "./scripts/run-cmake.sh && cd build && make -j8 && make -j8 install && ldconfig && ctest --output-on-failure"
android:
extends: java
image: upm-android
build:
dockerfile: docker/Dockerfile.android
environment:
- BUILDTESTS=OFF
command: bash -c "./scripts/build-android.sh"
node4:
extends: main
extends: base
image: upm-node4
build:
dockerfile: docker/Dockerfile.node
args:
- BUILDSWIGNODE=ON
- NODE_VERSION=v4.4.7
command: bash -c "make -j8 && make -j8 install && ldconfig && ctest --output-on-failure -E examplenames_js"
environment:
- BUILDSWIGNODE=ON
command: bash -c "./scripts/run-cmake.sh && cd build && make -j8 && make -j8 install && ldconfig && ctest --output-on-failure -E examplenames_js"
node5:
extends: node4
image: upm-node5
build:
args:
- NODE_VERSION=v5.12.0
node6:
extends: node4
image: upm-node6
build:
args:
- NODE_VERSION=v6.11.0