Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 1 | # Copyright (C) 2017 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Primiano Tucci | 185c8a5 | 2017-11-09 21:27:44 +0000 | [diff] [blame] | 15 | notifications: |
Primiano Tucci | 2a77fe5 | 2017-12-11 10:33:45 +0000 | [diff] [blame] | 16 | email: false |
Primiano Tucci | 185c8a5 | 2017-11-09 21:27:44 +0000 | [diff] [blame] | 17 | |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 18 | language: cpp |
| 19 | |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 20 | # The |CFG| variable name is hooked up by the perfetto-ci.appspot.com frontend. |
| 21 | # Please keep infra/perfetto-ci.appspot.com/ updated when adding/removing |
| 22 | # entries below. |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 23 | matrix: |
| 24 | include: |
Florian Mayer | b112e9f | 2018-01-26 13:16:10 +0000 | [diff] [blame] | 25 | # OS X builds are processing too slow and block the queue. |
| 26 | # Commenting out until the problem is resolved. |
| 27 | # - os: osx |
| 28 | # osx_image: xcode8.3 |
| 29 | # compiler: clang |
| 30 | # env: CFG=mac-clang-x86_64-release GN_ARGS="is_debug=false" |
| 31 | # - os: osx |
| 32 | # osx_image: xcode8.3 |
| 33 | # compiler: clang |
| 34 | # env: CFG=mac-clang-x86_64-debug GN_ARGS="is_debug=true" |
| 35 | # - os: osx |
| 36 | # osx_image: xcode8.3 |
| 37 | # compiler: clang |
| 38 | # env: CFG=mac-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true" |
| 39 | # - os: osx |
| 40 | # osx_image: xcode8.3 |
| 41 | # compiler: clang |
| 42 | # env: CFG=mac-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true" |
| 43 | # - os: osx |
| 44 | # osx_image: xcode8.3 |
| 45 | # compiler: clang |
| 46 | # env: CFG=mac-clang-x86_64-ubsan GN_ARGS="is_debug=false is_ubsan=true" |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 47 | - os: linux |
Primiano Tucci | 600d927 | 2019-05-13 19:53:21 +0100 | [diff] [blame] | 48 | dist: xenial |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 49 | sudo: false |
Primiano Tucci | 600d927 | 2019-05-13 19:53:21 +0100 | [diff] [blame] | 50 | # Test the system-version of clang, not our own at least in this config. |
Primiano Tucci | 24b9672 | 2017-10-30 17:49:11 +0000 | [diff] [blame] | 51 | addons: |
| 52 | apt: |
| 53 | packages: |
| 54 | - clang |
Florian Mayer | 6bbffa4 | 2018-01-18 19:04:52 +0000 | [diff] [blame] | 55 | env: CFG=linux_trusty-clang-x86_64-debug GN_ARGS="is_debug=true is_hermetic_clang=false" |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 56 | - os: linux |
Primiano Tucci | 600d927 | 2019-05-13 19:53:21 +0100 | [diff] [blame] | 57 | dist: xenial |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 58 | sudo: false |
| 59 | compiler: clang |
| 60 | env: CFG=linux_trusty-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true" |
| 61 | - os: linux |
Primiano Tucci | 600d927 | 2019-05-13 19:53:21 +0100 | [diff] [blame] | 62 | dist: xenial |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 63 | sudo: false |
| 64 | compiler: clang |
| 65 | env: CFG=linux_trusty-clang-x86_64-msan GN_ARGS="is_debug=false is_msan=true" |
Florian Mayer | 17f77e8 | 2018-10-02 19:08:36 +0100 | [diff] [blame] | 66 | # TODO(b/117093687): ubsan always times out in Travis. |
Florian Mayer | 7f61afa | 2018-10-01 17:19:22 +0100 | [diff] [blame] | 67 | # Re-enable once that is fixed. |
Florian Mayer | 17f77e8 | 2018-10-02 19:08:36 +0100 | [diff] [blame] | 68 | - os: linux |
Primiano Tucci | 600d927 | 2019-05-13 19:53:21 +0100 | [diff] [blame] | 69 | dist: xenial |
Florian Mayer | 17f77e8 | 2018-10-02 19:08:36 +0100 | [diff] [blame] | 70 | sudo: true |
| 71 | compiler: clang |
| 72 | env: CFG=linux_trusty-clang-x86_64-asan_lsan GN_ARGS="is_debug=false is_asan=true is_lsan=true" |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 73 | - os: linux |
Primiano Tucci | 600d927 | 2019-05-13 19:53:21 +0100 | [diff] [blame] | 74 | dist: xenial |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 75 | sudo: false |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 76 | addons: |
| 77 | apt: |
| 78 | sources: |
| 79 | - ubuntu-toolchain-r-test |
| 80 | packages: |
| 81 | - g++-7 |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 82 | env: CFG=linux_trusty-gcc7-x86_64-release GN_ARGS="is_debug=false is_clang=false use_custom_libcxx=false cc=\"gcc-7\" cxx=\"g++-7\"" |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 83 | - os: linux |
Primiano Tucci | 600d927 | 2019-05-13 19:53:21 +0100 | [diff] [blame] | 84 | dist: xenial |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 85 | sudo: false |
| 86 | compiler: clang |
| 87 | env: CFG=android-clang-arm-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\"" |
| 88 | - os: linux |
Primiano Tucci | 600d927 | 2019-05-13 19:53:21 +0100 | [diff] [blame] | 89 | dist: xenial |
Florian Mayer | 5664ea6 | 2018-01-10 16:28:35 +0000 | [diff] [blame] | 90 | sudo: true |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 91 | compiler: clang |
| 92 | env: CFG=android-clang-arm-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\" is_asan=true" |
Florian Mayer | 4c3580f | 2018-02-12 15:59:55 +0000 | [diff] [blame] | 93 | - os: linux |
Primiano Tucci | 600d927 | 2019-05-13 19:53:21 +0100 | [diff] [blame] | 94 | dist: xenial |
Florian Mayer | 4c3580f | 2018-02-12 15:59:55 +0000 | [diff] [blame] | 95 | sudo: true |
| 96 | compiler: clang |
Florian Mayer | 631cb2c | 2018-12-10 18:07:15 +0000 | [diff] [blame] | 97 | env: CFG=linux_trusty-clang-x86_64-libfuzzer GN_ARGS="is_clang=true is_debug=false is_fuzzer=true is_asan=true" |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 98 | - os: linux |
Primiano Tucci | 600d927 | 2019-05-13 19:53:21 +0100 | [diff] [blame] | 99 | dist: xenial |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 100 | sudo: false |
| 101 | compiler: clang |
| 102 | env: CFG=ui-clang-x86_64-release GN_ARGS="is_debug=false is_clang=true" |
Hector Dearman | 95b4f94 | 2018-07-11 13:29:04 +0100 | [diff] [blame] | 103 | - os: linux |
Primiano Tucci | 600d927 | 2019-05-13 19:53:21 +0100 | [diff] [blame] | 104 | dist: xenial |
Hector Dearman | 95b4f94 | 2018-07-11 13:29:04 +0100 | [diff] [blame] | 105 | sudo: false |
| 106 | compiler: clang |
| 107 | env: CFG=ui-clang-x86_64-debug GN_ARGS="is_debug=true is_clang=true" |
| 108 | |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 109 | |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 110 | # Cache the deps that get git-pulled to avoid hitting quota limits (b/68252114). |
| 111 | # Do not cache NDK/SDK and things that come from .zip files rather than git. |
| 112 | # Doing that is discouraged (https://docs.travis-ci.com/user/caching/). |
| 113 | cache: |
| 114 | timeout: 1800 # 30 mins |
| 115 | directories: |
Primiano Tucci | f1a2558 | 2018-12-07 00:53:51 +0000 | [diff] [blame] | 116 | - buildtools/android-core |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 117 | - buildtools/benchmark |
Primiano Tucci | f1a2558 | 2018-12-07 00:53:51 +0000 | [diff] [blame] | 118 | - buildtools/bionic |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame] | 119 | - buildtools/emulator |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 120 | - buildtools/googletest |
Primiano Tucci | 0d72a31 | 2018-08-07 14:42:45 +0100 | [diff] [blame] | 121 | - buildtools/jsoncpp |
Primiano Tucci | 38faa6f | 2018-04-01 20:12:08 +0200 | [diff] [blame] | 122 | - buildtools/libbacktrace |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 123 | - buildtools/libcxx |
| 124 | - buildtools/libcxxabi |
Primiano Tucci | a65497e | 2018-09-26 19:53:58 +0100 | [diff] [blame] | 125 | - buildtools/libfuzzer |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 126 | - buildtools/libunwind |
Primiano Tucci | f1a2558 | 2018-12-07 00:53:51 +0000 | [diff] [blame] | 127 | - buildtools/linenoise |
| 128 | - buildtools/lzma |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 129 | |
| 130 | before_install: |
| 131 | - set -e |
| 132 | - echo "$CFG" && echo "$GN_ARGS" |
Florian Mayer | 52e594e | 2018-01-10 18:23:55 +0000 | [diff] [blame] | 133 | - export ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer |
| 134 | || echo /usr/bin/llvm-symbolizer-*)" |
Lalit Maganti | dfe69ca | 2018-10-30 12:18:23 +0000 | [diff] [blame] | 135 | - pip install --user protobuf |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 136 | |
| 137 | install: |
| 138 | - | |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 139 | if [[ "$CFG" == android-* ]]; then |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame] | 140 | tools/install-build-deps |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 141 | elif [[ "$CFG" == ui-* ]]; then |
| 142 | tools/install-build-deps --no-android --ui |
| 143 | else |
| 144 | tools/install-build-deps --no-android |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 145 | fi |
Florian Mayer | 52e594e | 2018-01-10 18:23:55 +0000 | [diff] [blame] | 146 | - | |
| 147 | if [[ -e buildtools/clang/bin/llvm-symbolizer ]]; then |
| 148 | export ASAN_SYMBOLIZER_PATH="buildtools/clang/bin/llvm-symbolizer" |
| 149 | fi |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 150 | |
| 151 | script: |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 152 | - tools/gn gen out/dist --args="${GN_ARGS}" --check |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 153 | - | |
| 154 | if [[ "$CFG" == ui-* ]]; then |
Primiano Tucci | 8478e6d | 2019-03-10 12:32:24 -0700 | [diff] [blame] | 155 | tools/ninja -C out/dist ui 2>&1 | grep -v "no version information" |
| 156 | elif [[ "$CFG" == *-libfuzzer ]]; then |
| 157 | tools/ninja -C out/dist fuzzers |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 158 | else |
Primiano Tucci | 8478e6d | 2019-03-10 12:32:24 -0700 | [diff] [blame] | 159 | tools/ninja -C out/dist |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 160 | fi |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 161 | - | |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 162 | TEST_TARGETS=" |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame] | 163 | perfetto_integrationtests |
Lalit Maganti | 79f2d7b | 2018-01-23 18:27:33 +0000 | [diff] [blame] | 164 | perfetto_unittests |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 165 | " |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 166 | if [[ "$CFG" == ui-* ]]; then |
Hector Dearman | 6c5e129 | 2018-06-27 15:42:32 +0100 | [diff] [blame] | 167 | out/dist/ui_unittests --ci |
Primiano Tucci | 8478e6d | 2019-03-10 12:32:24 -0700 | [diff] [blame] | 168 | elif [[ "$CFG" == *-libfuzzer ]]; then |
| 169 | # Run a single iteration each to make sure they are not crashing. |
| 170 | for fuzzer in $(find out/dist -name '*_fuzzer' -executable); do |
| 171 | $fuzzer -runs=1 |
| 172 | done |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 173 | elif [[ "$CFG" == android-* ]]; then |
| 174 | TARGET_ARCH=$(echo $CFG | cut -d- -f3) |
| 175 | tools/run_android_emulator --pid /tmp/emulator.pid -v & |
| 176 | for TEST_TARGET in $TEST_TARGETS; do |
| 177 | tools/run_android_test out/dist "$TEST_TARGET" |
| 178 | done |
| 179 | tools/run_android_test --env BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist "perfetto_benchmarks" |
| 180 | else |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 181 | for TEST_TARGET in $TEST_TARGETS; do |
| 182 | "out/dist/$TEST_TARGET" |
| 183 | done |
Lalit Maganti | 131b6e5 | 2018-03-29 18:29:31 +0100 | [diff] [blame] | 184 | BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist/perfetto_benchmarks |
Lalit Maganti | da1c1d0 | 2019-05-08 11:55:50 +0100 | [diff] [blame] | 185 | |
| 186 | tools/diff_test_trace_processor.py --test-type=queries out/dist/trace_processor_shell |
| 187 | tools/diff_test_trace_processor.py --test-type=metrics out/dist/trace_processor_shell |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 188 | fi |
| 189 | |
| 190 | after_script: |
| 191 | - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true |