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 |
| 48 | dist: trusty |
| 49 | sudo: false |
Primiano Tucci | 24b9672 | 2017-10-30 17:49:11 +0000 | [diff] [blame] | 50 | # When setting compiler: clang Travis pull a newer version of clang than |
| 51 | # the version that is shipped with Trusty. This is good for all the other |
| 52 | # configs, but we want to keep at least one target in the matrix to match |
| 53 | # the default version of clang that we have on our workstations. |
| 54 | addons: |
| 55 | apt: |
| 56 | packages: |
| 57 | - clang |
Florian Mayer | 6bbffa4 | 2018-01-18 19:04:52 +0000 | [diff] [blame] | 58 | 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] | 59 | - os: linux |
| 60 | dist: trusty |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 61 | sudo: false |
| 62 | compiler: clang |
| 63 | env: CFG=linux_trusty-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true" |
| 64 | - os: linux |
| 65 | dist: trusty |
| 66 | sudo: false |
| 67 | compiler: clang |
| 68 | env: CFG=linux_trusty-clang-x86_64-msan GN_ARGS="is_debug=false is_msan=true" |
| 69 | - os: linux |
| 70 | dist: trusty |
Florian Mayer | 5664ea6 | 2018-01-10 16:28:35 +0000 | [diff] [blame] | 71 | sudo: true |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 72 | compiler: clang |
Florian Mayer | e96d661 | 2018-02-12 16:24:35 +0000 | [diff] [blame] | 73 | env: CFG=linux_trusty-clang-x86_64-ubsan_asan_lsan GN_ARGS="is_debug=false is_ubsan=true is_asan=true is_lsan=true" |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 74 | - os: linux |
| 75 | dist: trusty |
| 76 | sudo: false |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 77 | addons: |
| 78 | apt: |
| 79 | sources: |
| 80 | - ubuntu-toolchain-r-test |
| 81 | packages: |
| 82 | - g++-7 |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 83 | 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] | 84 | - os: linux |
| 85 | dist: trusty |
| 86 | sudo: false |
| 87 | compiler: clang |
| 88 | env: CFG=android-clang-arm-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\"" |
| 89 | - os: linux |
| 90 | dist: trusty |
Florian Mayer | 5664ea6 | 2018-01-10 16:28:35 +0000 | [diff] [blame] | 91 | sudo: true |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 92 | compiler: clang |
| 93 | 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] | 94 | - os: linux |
| 95 | dist: trusty |
| 96 | sudo: true |
| 97 | compiler: clang |
| 98 | env: CFG=linux_trusty-clang-x86_64-libfuzzer GN_ARGS="is_clang=true is_debug=false use_libfuzzer=true is_asan=true" |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 99 | - os: linux |
| 100 | dist: trusty |
| 101 | sudo: false |
| 102 | compiler: clang |
| 103 | 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] | 104 | - os: linux |
| 105 | dist: trusty |
| 106 | sudo: false |
| 107 | compiler: clang |
| 108 | env: CFG=ui-clang-x86_64-debug GN_ARGS="is_debug=true is_clang=true" |
| 109 | |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 110 | |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 111 | # Cache the deps that get git-pulled to avoid hitting quota limits (b/68252114). |
| 112 | # Do not cache NDK/SDK and things that come from .zip files rather than git. |
| 113 | # Doing that is discouraged (https://docs.travis-ci.com/user/caching/). |
| 114 | cache: |
| 115 | timeout: 1800 # 30 mins |
| 116 | directories: |
| 117 | - buildtools/benchmark |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame] | 118 | - buildtools/emulator |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 119 | - buildtools/googletest |
Primiano Tucci | 0d72a31 | 2018-08-07 14:42:45 +0100 | [diff] [blame] | 120 | - buildtools/jsoncpp |
Primiano Tucci | 38faa6f | 2018-04-01 20:12:08 +0200 | [diff] [blame] | 121 | - buildtools/libbacktrace |
Primiano Tucci | 21d41a7 | 2018-09-24 23:12:04 +0100 | [diff] [blame] | 122 | - buildtools/linenoise |
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 | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 127 | |
| 128 | before_install: |
| 129 | - set -e |
| 130 | - echo "$CFG" && echo "$GN_ARGS" |
Florian Mayer | 52e594e | 2018-01-10 18:23:55 +0000 | [diff] [blame] | 131 | - export ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer |
| 132 | || echo /usr/bin/llvm-symbolizer-*)" |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 133 | |
| 134 | install: |
| 135 | - | |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 136 | if [[ "$CFG" == android-* ]]; then |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame] | 137 | tools/install-build-deps |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 138 | elif [[ "$CFG" == ui-* ]]; then |
| 139 | tools/install-build-deps --no-android --ui |
| 140 | else |
| 141 | tools/install-build-deps --no-android |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 142 | fi |
Florian Mayer | 52e594e | 2018-01-10 18:23:55 +0000 | [diff] [blame] | 143 | - | |
| 144 | if [[ -e buildtools/clang/bin/llvm-symbolizer ]]; then |
| 145 | export ASAN_SYMBOLIZER_PATH="buildtools/clang/bin/llvm-symbolizer" |
| 146 | fi |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 147 | |
| 148 | script: |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 149 | - tools/gn gen out/dist --args="${GN_ARGS}" --check |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 150 | - | |
| 151 | if [[ "$CFG" == ui-* ]]; then |
| 152 | tools/ninja -C out/dist -j8 ui 2>&1 | grep -v "no version information available" |
| 153 | else |
| 154 | tools/ninja -C out/dist -j8 |
| 155 | fi |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 156 | - | |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 157 | TEST_TARGETS=" |
Lalit Maganti | 367fcd5 | 2018-02-05 16:06:13 +0000 | [diff] [blame] | 158 | perfetto_integrationtests |
Lalit Maganti | 79f2d7b | 2018-01-23 18:27:33 +0000 | [diff] [blame] | 159 | perfetto_unittests |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 160 | " |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 161 | if [[ "$CFG" == ui-* ]]; then |
Hector Dearman | 6c5e129 | 2018-06-27 15:42:32 +0100 | [diff] [blame] | 162 | out/dist/ui_unittests --ci |
Primiano Tucci | fe19990 | 2018-06-04 12:33:04 +0200 | [diff] [blame] | 163 | elif [[ "$CFG" == android-* ]]; then |
| 164 | TARGET_ARCH=$(echo $CFG | cut -d- -f3) |
| 165 | tools/run_android_emulator --pid /tmp/emulator.pid -v & |
| 166 | for TEST_TARGET in $TEST_TARGETS; do |
| 167 | tools/run_android_test out/dist "$TEST_TARGET" |
| 168 | done |
| 169 | tools/run_android_test --env BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist "perfetto_benchmarks" |
| 170 | else |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 171 | for TEST_TARGET in $TEST_TARGETS; do |
| 172 | "out/dist/$TEST_TARGET" |
| 173 | done |
Lalit Maganti | 131b6e5 | 2018-03-29 18:29:31 +0100 | [diff] [blame] | 174 | BENCHMARK_FUNCTIONAL_TEST_ONLY=true out/dist/perfetto_benchmarks |
Florian Mayer | 4c3580f | 2018-02-12 15:59:55 +0000 | [diff] [blame] | 175 | if [[ "$CFG" == *-libfuzzer ]]; then |
| 176 | # Run a single iteration each to make sure they are not crashing. |
Florian Mayer | 029a303 | 2018-02-12 17:00:52 +0000 | [diff] [blame] | 177 | out/dist/end_to_end_shared_memory_fuzzer -runs=1 |
Florian Mayer | 4c3580f | 2018-02-12 15:59:55 +0000 | [diff] [blame] | 178 | out/dist/buffered_frame_deserializer_fuzzer -runs=1 |
| 179 | fi |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 180 | fi |
| 181 | |
| 182 | after_script: |
| 183 | - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true |