|
| 1 | +# Copyright - 2019 - Jan Christoph Uhde <[email protected]> |
| 2 | + |
| 3 | +## general travis |
| 4 | +# https://docs.travis-ci.com/user/environment-variables/ |
| 5 | +# https://docs.travis-ci.com/user/reference/linux |
| 6 | +# https://docs.travis-ci.com/user/reference/windows |
| 7 | +# https://docs.travis-ci.com/user/reference/osx |
| 8 | + |
| 9 | +## packages |
| 10 | +# https://docs.travis-ci.com/user/installing-dependencies#Installing-Packages-with-the-APT-Addon |
| 11 | +# https://apt.llvm.org/ |
| 12 | + |
| 13 | +os: linux |
| 14 | +dist: bionic |
| 15 | +language: cpp |
| 16 | +sudo: required |
| 17 | + |
| 18 | +env: |
| 19 | + global: |
| 20 | + # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created |
| 21 | + # via the "travis encrypt" command using the project repo's public key |
| 22 | + - secure: "U1c29thaYIX4rK9/aF9mgllQJ5qHbSSPEZMr+sR3VrGVGVBPBZ3rCV8ytqrOX9N8U1v68hJJPn5Qo+o1xXI8/tlW/mDZrDe50S6J2XtLiQXZfaQxB+3itF08vWONSK9G9P9RbXxruVBz4jNCtl4uhXOH1Y3QQoTL/ag8se1lAZ/8fvIKe5IA+HlIVCkcI6qV0XfCD8DlYilbq+65S5zdqJ+ER+/o+QjViaX6suXIsFp+kqRHjrn/4B+Bd32ZfWERDL4UmFGu4HrvTc5A+WpT2/Qt0lYo8mce4kFnmMlhxx989M18ZOZS+wTH7QtZwzc8CUQytjg6Q97SYtOsXZqpRI3A2OoZitt715Yg27Um4XFmIOPUFgoxdJ0tDTixZBxKCuSWfZes61AlcD5bILhRSQAkjuKss0poIJXTCBFfFvSlbj1rrTbeK9ZxsaHYQ9dFcVxAuRdDS0YtQLZv/ldaQygOQZVQ8pijU1w366gDlN5qYkXS9N3+YzsFF3RdJ8072060F30f/xp6fekazBmk8Bao/WrXJrRJT3aY3IsQsaI55mL82scyS0F9otWkCWA1VYvpBmCkllLX0CJSTERjT7MT+uOK65uQpCY43keb5h+e7cji0d62HBlkpwfpvqGpbaRceppetc4rUM7UTG+MOduuHlXjwh1XZkeNKkwr1ek=" |
| 23 | + - ARCH=amd64 |
| 24 | + - build_type=Release |
| 25 | + - tests=ON |
| 26 | + - examples=ON |
| 27 | + - coverage=false |
| 28 | + |
| 29 | +matrix: |
| 30 | + include: |
| 31 | + - name: "default" |
| 32 | + env: |
| 33 | + - CXX=g++-9 |
| 34 | + - CC=gcc-9 |
| 35 | + - build_type=Debug |
| 36 | + before_script: |
| 37 | + - $project_root/support/travis/flake8 |
| 38 | + |
| 39 | + - name: "asan" |
| 40 | + if: branch = master |
| 41 | + env: |
| 42 | + - CXX=g++-9 |
| 43 | + - CC=gcc-9 |
| 44 | + - CXXFLAGS=" -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fno-omit-frame-pointer -fno-sanitize=vptr -pthread " |
| 45 | + |
| 46 | + - name: "coverage" |
| 47 | + #if: branch =~ /master|coverage/ |
| 48 | + if: branch =~ /coverage/ |
| 49 | + env: |
| 50 | + - CXX=g++-7 |
| 51 | + - CC=gcc-7 |
| 52 | + - CXXFLAGS="-O0 --coverage" |
| 53 | + #build settings |
| 54 | + - build_type=Debug |
| 55 | + - examples=OFF |
| 56 | + - coverage=true |
| 57 | + addons: |
| 58 | + apt: |
| 59 | + #we need gcc7 for lcov to work |
| 60 | + packages: ['gcc-7', 'g++-7', 'lcov'] |
| 61 | + |
| 62 | + - name: "clang" |
| 63 | + if: branch = travis |
| 64 | + env: |
| 65 | + - CXX=clang++-10 |
| 66 | + - CC=clang-10 |
| 67 | + addons: |
| 68 | + apt: |
| 69 | + sources: |
| 70 | + #- ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-8'] |
| 71 | + - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' |
| 72 | + key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key" |
| 73 | + packages: ['clang-10', 'clang++-10', 'clang-format-10', 'clang-tools-10', 'libc++-10-dev', 'libc++abi-10-dev'] |
| 74 | + |
| 75 | + - name: "mac" |
| 76 | + if: branch = travis |
| 77 | + os: osx |
| 78 | + osx_image: xcode11.2 |
| 79 | + compiler: clang |
| 80 | + |
| 81 | + - name: "coverity scan" |
| 82 | + if: branch = coverity_scan |
| 83 | + env: |
| 84 | + - CXX=g++-7 |
| 85 | + - CC=gcc-7 |
| 86 | + addons: |
| 87 | + apt: |
| 88 | + #we need gcc7 for lcov to work |
| 89 | + packages: ['gcc-7', 'g++-7', 'lcov'] |
| 90 | + |
| 91 | + coverity_scan: |
| 92 | + project: |
| 93 | + name: extcpp/basics |
| 94 | + version: 0.1 |
| 95 | + description: ext::basics library |
| 96 | + notification_email: [email protected] |
| 97 | + #build_command_prepend: | |
| 98 | + # export ${CXX} |
| 99 | + # export ${CC} |
| 100 | + # export ${CXXFLAGS} |
| 101 | + # cov-configure --comptype gcc --compiler /usr/bin/g++-7 -- -std=gnu++1z |
| 102 | + # cmake -DCMAKE_BUILD_TYPE=Debug -DEXTLOG_TESTS=ON -DEXTLOG_EXAMPLES=ON . |
| 103 | + #build_command: "cmake --build . --config Debug" |
| 104 | + build_command_prepend: | |
| 105 | + cov-configure --comptype g++ --compiler /usr/bin/g++-7 -- -std=gnu++1z |
| 106 | + cmake -DCMAKE_BUILD_TYPE=Debug -DEXTLOG_TESTS=ON -DEXTLOG_EXAMPLES=ON . |
| 107 | + build_command: "cmake --build . --config Debug" |
| 108 | + branch_pattern: coverity_scan |
| 109 | + before_script: |
| 110 | + # fix for coverity scans |
| 111 | + - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- |
| 112 | + - sudo curl -s -L https://entrust.com/root-certificates/entrust_l1k.cer -o /usr/local/share/ca-certificates/entrust_l1k.crt |
| 113 | + - sudo update-ca-certificates |
| 114 | + script: |
| 115 | + - echo 'no build required ... done' |
| 116 | + # debug covertiy scan |
| 117 | + - cat cov-int/build-log.txt |
| 118 | + - cat cov-int/scm_log.txt |
| 119 | + |
| 120 | +before_install: |
| 121 | + # for some reason CXX and CC can not be set in env |
| 122 | + - export CXX=${CXX:-g++} |
| 123 | + - export CC=${CC:-gcc} |
| 124 | + - export CXXFLAGS=${CXXFLAGS:-""} |
| 125 | + # set defaults |
| 126 | + - if ${verbose:-false}; then export VERBOSE=1; fi |
| 127 | + - export ARCH=${ARCH:-amd64} |
| 128 | + - export EXT_CI=true |
| 129 | + - export EXT_CI_BRANCH=${TRAVIS_BRANCH} |
| 130 | + # calculate pojects paths |
| 131 | + - export PATH="$install_root/bin:$PATH" |
| 132 | + - export project_root="$PWD" |
| 133 | + - export build_base="${project_root}-build" |
| 134 | + - export build_root="${build_base}/$build_type" |
| 135 | + - export install_root="$HOME/usr" |
| 136 | + - export build_prefix='<>' |
| 137 | + |
| 138 | +install: |
| 139 | + - echo $project_root |
| 140 | + - git clone https://github.com/extcpp/build-support --recurse-submodules ../build-support |
| 141 | + - ../build-support/setup-support . ../build-support |
| 142 | + # system info |
| 143 | + - ../build-support/lib/bash_build_scripts/system_info |
| 144 | + - ../build-support/lib/bash_build_scripts/var_info |
| 145 | + - mkdir "$install_root" |
| 146 | + - mkdir -p "$build_root" |
| 147 | + - ln -s "$build_root" "$build_base/current" |
| 148 | + - sudo $project_root/support/travis/install-$ARCH-$TRAVIS_OS_NAME |
| 149 | + - ../build-support/lib/bash_build_scripts/install_cmake |
| 150 | + - ../build-support/lib/bash_build_scripts/install_3rd_party |
| 151 | + |
| 152 | +before_script: |
| 153 | + |
| 154 | +script: |
| 155 | + - ../build-support/lib/bash_build_scripts/var_info |
| 156 | + - | |
| 157 | + ../build-support/lib/bash_build_scripts/configure \ |
| 158 | + -DCMAKE_BUILD_TYPE="$build_type" \ |
| 159 | + -DEXTLOG_TESTS="$tests" \ |
| 160 | + -DEXTLOG_EXAMPLES="$examples" \ |
| 161 | + $cmake_extra_flags |
| 162 | + - ../build-support/lib/bash_build_scripts/build |
| 163 | + - if [[ $coverage == "false" ]]; then ../build-support/lib/bash_build_scripts/test $tests; fi |
| 164 | + - if [[ $coverage == "true" ]]; then ../build-support/scripts/coverage; fi |
0 commit comments