language: cpp # Use the latest Travis images since they are more up to date than the stable release. group: edge before_script: - export -f travis_fold script: - "bash -ex .travis-ci.sh" addons: apt: packages: &base_build # This is the absolute minimum for configure to pass # Non C++ based tasks use it so they can run make builtfiles - ccache - libcppunit-dev - bison - flex - uuid-dev - libprotobuf-dev - protobuf-compiler - libprotoc-dev packages: &core_build # This is all the bits we need to enable all options - *base_build - libftdi-dev - libftdi1 - libusb-1.0-0-dev - liblo-dev - libavahi-glib1 - libncurses5-dev - libmicrohttpd-dev packages: &core_build_clang_recent - *core_build - clang-10 packages: &core_build_gpp_latest - *core_build - g++-10 packages: &core_build_clang_latest - *core_build - clang-11 packages: &bionic_build_extras # To fix the build/add missing components - libtool - pkg-config packages: &bionic_build_extras_python2 - *bionic_build_extras - python-protobuf - python-numpy - python-pip packages: &bionic_build_extras_python3 - *bionic_build_extras # The apt packaged files don't seem to work with Bionic and Python 3, so do it via pip # To compile numpy - python3-dev # - python3-protobuf # - python3-numpy # - python3-pip homebrew: packages: &mac_core_build - ccache # This is all the bits we need to enable all options on Mac - bison - flex # Installing via the addon isn't currently working so do it the old fashioned way below # - https://raw.githubusercontent.com/Homebrew/homebrew-core/024ca9a4730a1f26ceede43485fbf62ef6f41179%5E/Formula/protobuf@3.1.rb - liblo - libmicrohttpd - ossp-uuid # Looks like this is Python 3 only, so install via pip # - numpy - libusb packages: &mac_cppunit_113 # Installing via the addon isn't currently working so do it the old fashioned way below # - https://raw.githubusercontent.com/Homebrew/homebrew-core/e6e43cf6a3^/Formula/cppunit.rb # install a slightly older cppunit, as latest needs C++11 support jobs: fast_finish: true include: - os: linux dist: bionic arch: arm64 env: TASK='doxygen' addons: apt: packages: - *core_build_gpp_latest - *bionic_build_extras_python2 - doxygen - graphviz sources: - ubuntu-toolchain-r-test - os: linux dist: bionic arch: arm64 env: TASK='lint' addons: apt: packages: - *core_build - *bionic_build_extras_python2 - os: linux dist: bionic arch: arm64 env: - TASK='check-licences' - PYTHON='python3' addons: apt: packages: - *core_build - *bionic_build_extras_python3 - os: linux dist: bionic arch: arm64 env: - TASK='codespell' - PYTHON='python3' addons: apt: packages: - *core_build - *bionic_build_extras_python3 - moreutils - os: linux dist: bionic arch: arm64 env: TASK='jshint' addons: apt: packages: - os: linux dist: bionic arch: arm64 env: TASK='flake8' python: '2.7' addons: apt: packages: - *base_build - *bionic_build_extras_python2 - os: linux dist: bionic arch: arm64 env: - TASK='flake8' - PYTHON='python3' addons: apt: packages: - *base_build - *bionic_build_extras_python3 # Only run Travis builds against the zero credit partner queue solution # - os: linux # dist: bionic # arch: amd64 # compiler: clang # env: # - TASK='compile' # - PYTHON='python3' # addons: # apt: # packages: # - *core_build_clang_latest # - *bionic_build_extras_python3 # sources: # - sourceline: "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main" # key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key" # - sourceline: "ppa:ubuntu-toolchain-r/test" # - os: linux # dist: bionic # arch: amd64 # compiler: gcc # env: TASK='compile' # python: '2.7' # addons: # apt: # packages: # - *core_build_gpp_latest # - *bionic_build_extras_python2 # sources: # - ubuntu-toolchain-r-test - os: linux dist: bionic arch: arm64 compiler: clang env: - TASK='compile' - PYTHON='python3' addons: apt: packages: - *core_build_clang_recent - *bionic_build_extras_python3 - os: linux dist: bionic arch: arm64 compiler: gcc env: TASK='compile' python: '2.7' addons: apt: packages: - *core_build_gpp_latest - *bionic_build_extras_python2 sources: - ubuntu-toolchain-r-test - os: linux dist: bionic arch: s390x compiler: clang env: TASK='compile' python: '2.7' addons: apt: packages: - *core_build_clang_recent - *bionic_build_extras_python2 - os: linux dist: bionic arch: s390x compiler: gcc env: TASK='compile' python: '2.7' addons: apt: packages: - *core_build_gpp_latest - *bionic_build_extras_python2 sources: - ubuntu-toolchain-r-test # - os: osx # osx_image: xcode9.4 # compiler: clang # env: # - TASK='compile' # - CPPUNIT='1.13' # - PROTOBUF='latest' # - LIBFTDI='0' # addons: # homebrew: # packages: # - *mac_core_build # - *mac_cppunit_113 # - protobuf # - libftdi0 # update: false # - os: osx # osx_image: xcode9.4 # compiler: gcc # env: # - TASK='compile' # - CPPUNIT='1.13' # - PROTOBUF='latest' # - LIBFTDI='0' # addons: # homebrew: # packages: # - *mac_core_build # - *mac_cppunit_113 # - protobuf # - libftdi0 # update: false # - os: osx # osx_image: xcode9.4 # compiler: clang # env: # - TASK='compile' # - CPPUNIT='1.14' # - PROTOBUF='latest' # - LIBFTDI='0' # addons: # homebrew: # packages: # - *mac_core_build # - cppunit # - protobuf # - libftdi0 # update: false # - os: osx # osx_image: xcode9.4 # compiler: gcc # env: # - TASK='compile' # - CPPUNIT='1.14' # - PROTOBUF='latest' # - LIBFTDI='0' # addons: # homebrew: # packages: # - *mac_core_build # - cppunit # - protobuf # - libftdi0 # update: false # - os: osx # osx_image: xcode9.4 # compiler: clang # env: # - TASK='compile' # - CPPUNIT='1.14' # - PROTOBUF='latest' # - LIBFTDI='1' # addons: # homebrew: # packages: # - *mac_core_build # - cppunit # - protobuf # - libftdi # install the latest cppunit, which needs C++11 # update: false # - os: osx # osx_image: xcode9.4 # compiler: gcc # env: # - TASK='compile' # - CPPUNIT='1.14' # - PROTOBUF='latest' # - LIBFTDI='1' # addons: # homebrew: # packages: # - *mac_core_build # - cppunit # - protobuf # - libftdi # install the latest cppunit, which needs C++11 # update: false - os: linux dist: bionic arch: arm64 compiler: gcc env: TASK='coverage' addons: apt: packages: - *core_build_gpp_latest sources: - sourceline: "ppa:ubuntu-toolchain-r/test" - os: linux dist: xenial arch: arm64 compiler: gcc env: TASK='coverity' addons: apt: packages: # Coverity doesn't work with g++-5 or g++-6 yet - *core_build - g++-4.9 sources: - sourceline: "ppa:ubuntu-toolchain-r/test" - os: linux dist: bionic arch: arm64 env: TASK='spellintian' addons: apt: packages: - *core_build - *bionic_build_extras_python2 - lintian - moreutils - os: linux dist: bionic arch: arm64 env: TASK='spellintian-duplicates' addons: apt: packages: - *core_build - *bionic_build_extras_python2 - lintian - moreutils allow_failures: # - os: osx # osx_image: xcode9.4 # compiler: clang # env: # - TASK='compile' # - CPPUNIT='1.13' # - LIBFTDI='0' # - os: osx # osx_image: xcode9.4 # compiler: clang # env: # - TASK='compile' # - CPPUNIT='1.14' # - LIBFTDI='0' # - os: osx # osx_image: xcode9.4 # compiler: gcc # env: # - TASK='compile' # - CPPUNIT='1.13' # - LIBFTDI='0' # - os: osx # osx_image: xcode9.4 # compiler: gcc # env: # - TASK='compile' # - CPPUNIT='1.14' # - LIBFTDI='0' # - os: osx # osx_image: xcode9.4 # compiler: clang # env: # - TASK='compile' # - CPPUNIT='1.14' # - LIBFTDI='1' # - os: osx # osx_image: xcode9.4 # compiler: gcc # env: # - TASK='compile' # - CPPUNIT='1.14' # - LIBFTDI='1' - os: osx osx_image: xcode9.4 compiler: clang env: - TASK='compile' - CPPUNIT='1.14' - PROTOBUF='latest' - LIBFTDI='1' - os: osx osx_image: xcode9.4 compiler: gcc env: - TASK='compile' - CPPUNIT='1.14' - PROTOBUF='latest' - LIBFTDI='1' - os: linux dist: bionic arch: arm64 compiler: gcc env: TASK='coverage' - os: linux dist: xenial arch: arm64 compiler: gcc env: TASK='coverity' - os: linux dist: bionic arch: arm64 env: TASK='spellintian' - os: linux dist: bionic arch: arm64 env: TASK='spellintian-duplicates' env: global: # No colours in terminal (to reduce log file size) - TERM=dumb # Parallel make build - MAKEFLAGS="-j 2" # -- BEGIN Coverity Scan ENV - COVERITY_SCAN_BUILD_COMMAND_PREPEND="cov-configure --comptype gcc --compiler gcc-4.9 --template && autoreconf -i && ./configure --enable-ja-rule --enable-e133" # The build command with all of the arguments that you would apply to a manual `cov-build` # Usually this is the same as STANDARD_BUILD_COMMAND, excluding the automated test arguments - COVERITY_SCAN_BUILD_COMMAND="make" # Name of the project - COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG" # Email address for notifications related to this build - COVERITY_SCAN_NOTIFICATION_EMAIL="ola-coverity@pjnewman.co.uk" # Regular expression selects on which branches to run analysis # Be aware of quotas. Do not run on every branch/commit - COVERITY_SCAN_BRANCH_PATTERN=".*" # COVERITY_SCAN_TOKEN via "travis encrypt" using the repo's public key - secure: "U+NmPtScHZ1NLmkDrzpqApHmJvELV44cXgjQsxA8N8xIATckbs+DrmWSNeECENyvuOPz+nPzglSgBvJtejf97jYJIIwAExq5TJMUAIPFS6KU3mohODW2PZSoVoUyJPzFIlhzcELQgONI+ILLm29lNdQNb7GFUVtO6+jS10AFtWY=" # -- END Coverity Scan ENV cache: apt: true ccache: true npm: true pip: true directories: - $HOME/Library/Caches/Homebrew # homebrew bottle cache before_cache: - rm -f $HOME/.cache/pip/log/debug.log # erase log - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cleanup; fi # avoid caching old package versions - ccache -s # see how many hits ccache got before_install: - if [ "$PYTHON" == "python3" -a "$TRAVIS_CPU_ARCH" != "arm64" ]; then pyenv global 3.8.1; fi #On arm64 (at least) pip is now pip3, so symlink it to pip2 unless we're using python3. - if [ "$PYTHON" != "python3" ]; then sudo rm /usr/local/bin/pip && sudo ln -s /usr/local/bin/pip2 /usr/local/bin/pip; fi #Switch node to version 16 LTS, as newer LTS ones don't work with Ubuntu 18.04 and some older ones are too old - if [ "$TASK" = "jshint" ]; then nvm install 16 && nvm use 16; fi #Fix permissions for unbound (and possibly others) - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [ ! -d /usr/local/sbin ]; then sudo mkdir -p /usr/local/sbin && sudo chown -R $(whoami) /usr/local/sbin; fi; fi #Add a missing gnupg folder - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [ ! -d /usr/local/Cellar/gnupg2/2.2.5 ]; then sudo mkdir -p /usr/local/Cellar/gnupg2/2.2.5 && sudo chown -R $(whoami) /usr/local/Cellar/gnupg2/2.2.5; fi; fi #We install packages via brew which pull in numpy, so try a reinstall over the pip numpy to avoid conflicts - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew reinstall numpy || brew link --overwrite numpy; fi #Fix a broken homebrew libtool install - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew reinstall libtool; fi #Fix a broken homebrew gnupg install - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew uninstall --ignore-dependencies gnupg; fi #Fix a broken homebrew python upgrade - see https://github.com/Homebrew/homebrew-core/issues/26358 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade python || true; fi #Uninstall some homebrew packages which aren't required so we don't end up updating and rebuilding them. Force so it doesn't reinstall - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew uninstall --ignore-dependencies --force cgal liblwgeom libspatialite mercurial postgis postgres sfcgal; fi #Having fixed everything up, update to the bleeding edge #Skip updating for now as it seems to be breaking the build, also now done via the addon # - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi # This is no longer allowed, so build all Mac builds as protobuf latest #- if [ "$TRAVIS_OS_NAME" == "osx" -a "$PROTOBUF" != "latest" ]; then brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/024ca9a4730a1f26ceede43485fbf62ef6f41179%5E/Formula/protobuf@3.1.rb; fi # install protobuf 3.1 as that's the latest we support everywhere #- if [ "$TRAVIS_OS_NAME" == "osx" -a "$PROTOBUF" != "latest" ]; then brew link -f https://raw.githubusercontent.com/Homebrew/homebrew-core/024ca9a4730a1f26ceede43485fbf62ef6f41179%5E/Formula/protobuf@3.1.rb; export PKG_CONFIG_PATH=/usr/local/opt/protobuf@3.1/lib/pkgconfig; brew install --build-from-source --ignore-dependencies --env=std protobuf-c; fi # While protobuf is not on the latest release - if [ "$TRAVIS_OS_NAME" == "osx" -a "$PROTOBUF" != "latest" ]; then brew install protobuf@3.6; fi - if [ "$TRAVIS_OS_NAME" == "osx" -a "$PROTOBUF" != "latest" ]; then brew link -f protobuf@3.6; export PKG_CONFIG_PATH=/usr/local/opt/protobuf@3.6/lib/pkgconfig; brew install --build-from-source --ignore-dependencies --env=std protobuf-c; fi # When protobuf is not on the latest release - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p ${HOME}/Library/Python/2.7/lib/python/site-packages; echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> ${HOME}/Library/Python/2.7/lib/python/site-packages/homebrew.pth; fi - if [ "$TRAVIS_OS_NAME" == "osx" -a "$CPPUNIT" != "1.14" ]; then brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/e6e43cf6a3%5E/Formula/cppunit.rb; fi # install a slightly older cppunit, as latest needs C++11 support - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/ccache/libexec:$PATH; fi # Use ccache on Mac too #Put back the old pip numpy we need to work - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip install --upgrade --no-deps --force-reinstall --user numpy; fi #Coverity doesn't work with g++ 5 or 6, so only upgrade to g++ 4.9 for that - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "coverage" -o "$TASK" = "doxygen" \) -a "$CXX" = "g++" ]; then export CXX="ccache g++-10" CC="ccache gcc-10"; fi - if [ "$TASK" = "coverity" -a "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi #Use the latest clang if we're compiling with clang, except on arm64 and s390x where it's not available - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CXX" = "clang++" -a "$TRAVIS_CPU_ARCH" != "arm64" -a "$TRAVIS_CPU_ARCH" != "s390x" ]; then export CXX="clang++-11" CC="clang-11"; fi #Use a recent clang if we're compiling with clang on arm64 or s390x as the latest isn't available - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CXX" = "clang++" -a \( "$TRAVIS_CPU_ARCH" == "arm64" -o "$TRAVIS_CPU_ARCH" == "s390x" \) ]; then export CXX="clang++-10" CC="clang-10"; fi #Report the compiler version - $CXX --version install: # Match the version of protobuf being installed via apt/Homebrew - if [ "$PROTOBUF" == "latest" -a \( "$TRAVIS_DIST" != "bionic" -o "$PYTHON" == "python3" \) ]; then pip install --user protobuf; fi - if [ "$PROTOBUF" != "latest" -a \( "$TRAVIS_DIST" != "bionic" -o "$PYTHON" == "python3" \) ]; then pip install --user protobuf==3.1.0; fi # disable until can be added to all build variants #- pip install --user timeout-decorator # We sometimes need to use pip rather than apt on Bionic - if [ "$TRAVIS_OS_NAME" == "linux" -a "$TRAVIS_DIST" == "bionic" -a "$TRAVIS_CPU_ARCH" != "arm64" ]; then pip install --user wheel; fi # Wheel only needed to fix a broken bionic build # Install numpy via deb where it works, otherwise on OS X and non-bionic Python 2 Linux install via pip - if [ "$TRAVIS_DIST" != "bionic" -o "$PYTHON" == "python3" ]; then pip install --user numpy; fi - if [ "$TASK" = "coverage" ]; then pip install --user cpp-coveralls; fi - if [ "$TASK" = "flake8" ]; then pip install --user flake8; fi - if [ "$TASK" = "codespell" ]; then pip3 install --user codespell==2.2.1; fi - if [ "$TASK" = "jshint" ]; then npm --verbose install -g grunt-cli; fi - if [ "$TASK" = "jshint" ]; then grunt --version --verbose; fi # Installing via the addon isn't currently working so do it the old fashioned way - if [ "$TRAVIS_OS_NAME" == "osx" -a "$CPPUNIT" != "1.14" ]; then brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/e6e43cf6a3%5E/Formula/cppunit.rb; fi # install a slightly older cppunit, as latest needs C++11 support after_failure: - if [ -f ${TRAVIS_BUILD_DIR}/config.log ]; then cat ${TRAVIS_BUILD_DIR}/config.log; fi - if [ -f ${TRAVIS_BUILD_DIR}/ola-*/_build/config.log ]; then cat ${TRAVIS_BUILD_DIR}/ola-*/_build/config.log; fi - if [ -f ${TRAVIS_BUILD_DIR}/ola-*/_build/sub/config.log ]; then cat ${TRAVIS_BUILD_DIR}/ola-*/_build/sub/config.log; fi after_success: - if [ "$TASK" = "coverage" ]; then coveralls --gcov /usr/bin/gcov-10 -b . -E '.*Test\.cpp$' -E '.*\.pb\.cc$' -E '.*\.pb\.cpp$' -E '.*\.pb\.h$' -E '.*\.yy\.cpp$' -E '.*\.tab\.cpp$' -E '.*\.tab\.h$' -E '.*/doxygen/examples.*$' --gcov-options '\-lp' > /dev/null; fi after_script: - if [ "$TASK" = "coverity" ]; then tail -n 10000 ${TRAVIS_BUILD_DIR}/cov-int/build-log.txt; cat ${TRAVIS_BUILD_DIR}/cov-int/scm_log.txt; fi notifications: irc: channels: - "chat.freenode.net#openlighting" on_success: change on_failure: change