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: |
| 25 | - os: osx |
| 26 | osx_image: xcode8.3 |
| 27 | compiler: clang |
| 28 | env: CFG=mac-clang-x86_64-release GN_ARGS="is_debug=false" |
| 29 | - os: osx |
| 30 | osx_image: xcode8.3 |
| 31 | compiler: clang |
| 32 | env: CFG=mac-clang-x86_64-debug GN_ARGS="is_debug=true" |
| 33 | - os: osx |
| 34 | osx_image: xcode8.3 |
| 35 | compiler: clang |
| 36 | env: CFG=mac-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true" |
| 37 | - os: osx |
| 38 | osx_image: xcode8.3 |
| 39 | compiler: clang |
| 40 | env: CFG=mac-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true" |
| 41 | - os: osx |
| 42 | osx_image: xcode8.3 |
| 43 | compiler: clang |
| 44 | env: CFG=mac-clang-x86_64-ubsan GN_ARGS="is_debug=false is_ubsan=true" |
| 45 | - os: linux |
| 46 | dist: trusty |
| 47 | sudo: false |
Primiano Tucci | 24b9672 | 2017-10-30 17:49:11 +0000 | [diff] [blame] | 48 | # When setting compiler: clang Travis pull a newer version of clang than |
| 49 | # the version that is shipped with Trusty. This is good for all the other |
| 50 | # configs, but we want to keep at least one target in the matrix to match |
| 51 | # the default version of clang that we have on our workstations. |
| 52 | addons: |
| 53 | apt: |
| 54 | packages: |
| 55 | - clang |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 56 | env: CFG=linux_trusty-clang-x86_64-debug GN_ARGS="is_debug=true" |
| 57 | - os: linux |
| 58 | dist: trusty |
| 59 | sudo: false |
| 60 | compiler: clang |
| 61 | env: CFG=linux_trusty-clang-x86_64-asan GN_ARGS="is_debug=false is_asan=true" |
| 62 | - os: linux |
| 63 | dist: trusty |
| 64 | sudo: false |
| 65 | compiler: clang |
| 66 | env: CFG=linux_trusty-clang-x86_64-tsan GN_ARGS="is_debug=false is_tsan=true" |
| 67 | - os: linux |
| 68 | dist: trusty |
| 69 | sudo: false |
| 70 | compiler: clang |
| 71 | env: CFG=linux_trusty-clang-x86_64-msan GN_ARGS="is_debug=false is_msan=true" |
| 72 | - os: linux |
| 73 | dist: trusty |
| 74 | sudo: false |
| 75 | compiler: clang |
| 76 | env: CFG=linux_trusty-clang-x86_64-lsan GN_ARGS="is_debug=false is_lsan=true" |
| 77 | - os: linux |
| 78 | dist: trusty |
| 79 | sudo: false |
| 80 | compiler: clang |
| 81 | env: CFG=linux_trusty-clang-x86_64-ubsan GN_ARGS="is_debug=false is_ubsan=true" |
| 82 | - os: linux |
| 83 | dist: trusty |
| 84 | sudo: false |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 85 | addons: |
| 86 | apt: |
| 87 | sources: |
| 88 | - ubuntu-toolchain-r-test |
| 89 | packages: |
| 90 | - g++-7 |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 91 | 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] | 92 | - os: linux |
| 93 | dist: trusty |
| 94 | sudo: false |
| 95 | compiler: clang |
| 96 | env: CFG=android-clang-arm-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\"" |
| 97 | - os: linux |
| 98 | dist: trusty |
| 99 | sudo: false |
| 100 | compiler: clang |
| 101 | env: CFG=android-clang-arm64-release GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm64\"" |
| 102 | - os: linux |
| 103 | dist: trusty |
| 104 | sudo: false |
| 105 | compiler: clang |
| 106 | env: CFG=android-clang-arm-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm\" is_asan=true" |
| 107 | - os: linux |
| 108 | dist: trusty |
| 109 | sudo: false |
| 110 | compiler: clang |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 111 | env: CFG=android-clang-arm64-asan GN_ARGS="is_debug=false target_os=\"android\" target_cpu=\"arm64\" is_asan=true" |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 112 | |
Primiano Tucci | 636ede1 | 2017-10-30 16:03:07 +0000 | [diff] [blame] | 113 | # Cache the deps that get git-pulled to avoid hitting quota limits (b/68252114). |
| 114 | # Do not cache NDK/SDK and things that come from .zip files rather than git. |
| 115 | # Doing that is discouraged (https://docs.travis-ci.com/user/caching/). |
| 116 | cache: |
| 117 | timeout: 1800 # 30 mins |
| 118 | directories: |
| 119 | - buildtools/benchmark |
| 120 | - buildtools/googletest |
| 121 | - buildtools/libcxx |
| 122 | - buildtools/libcxxabi |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 123 | - buildtools/libunwind |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 124 | |
| 125 | before_install: |
| 126 | - set -e |
| 127 | - echo "$CFG" && echo "$GN_ARGS" |
| 128 | - ASAN_SYMBOLIZER_PATH="$(which llvm-symbolizer || echo /usr/bin/llvm-symbolizer-*)" |
| 129 | |
| 130 | install: |
| 131 | - | |
| 132 | if [[ "$CFG" != android-* ]]; then |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 133 | tools/install-build-deps --no-android |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 134 | else |
Primiano Tucci | bf76f4f | 2017-12-14 00:57:54 +0000 | [diff] [blame] | 135 | ARCH=$(echo "$CFG" | cut -d- -f3) |
| 136 | tools/install-build-deps --emulator="$ARCH" |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 137 | fi |
| 138 | |
| 139 | script: |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 140 | - tools/gn gen out/dist --args="${GN_ARGS}" --check |
| 141 | - tools/ninja -C out/dist -j8 all |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 142 | - | |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 143 | TEST_TARGETS=" |
Primiano Tucci | b03ba36 | 2017-12-06 09:47:41 +0000 | [diff] [blame] | 144 | perfetto_tests |
| 145 | perfetto_benchmarks |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 146 | " |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 147 | if [[ "$CFG" != android-* ]]; then |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 148 | for TEST_TARGET in $TEST_TARGETS; do |
| 149 | "out/dist/$TEST_TARGET" |
| 150 | done |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 151 | else |
| 152 | TARGET_ARCH=$(echo $CFG | cut -d- -f3) |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 153 | tools/run_android_emulator $TARGET_ARCH --pid /tmp/emulator.pid -v & |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 154 | for TEST_TARGET in $TEST_TARGETS; do |
Primiano Tucci | 7a40e4d | 2017-12-06 09:51:09 +0000 | [diff] [blame] | 155 | tools/run_android_test out/dist "$TEST_TARGET" |
Primiano Tucci | 7278dea | 2017-10-31 11:50:32 +0000 | [diff] [blame] | 156 | done |
Primiano Tucci | d770e57 | 2017-10-01 05:28:39 -0700 | [diff] [blame] | 157 | fi |
| 158 | |
| 159 | after_script: |
| 160 | - test -f /tmp/emulator.pid && kill -9 $(cat /tmp/emulator.pid); true |