Roger Meier | a0836f6 | 2013-05-05 00:19:38 +0200 | [diff] [blame] | 1 | # |
| 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
| 20 | # build Apache Thrift on Travis CI - https://travis-ci.org/ |
| 21 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 22 | # |
| 23 | # Docker Integration |
| 24 | # |
| 25 | # DOCKER_REPO |
| 26 | # [required] The repository name (within your account). |
| 27 | # DOCKER_PASS |
| 28 | # [optional, secure] Your docker account password. |
| 29 | # If you do not set this, each build job in the "test" |
| 30 | # stage might rebuild the docker image and extend build |
| 31 | # time by about 10 minutes per job. If you do set this |
| 32 | # then each build job in the "docker" stage" will build |
| 33 | # the docker image if Dockerfile has changed, and then |
| 34 | # push the new tag up to your docker hub account. |
| 35 | # DOCKER_USER |
| 36 | # [required] Your docker hub account name. |
| 37 | # |
| 38 | # The resulting tag is: |
| 39 | # $DOCKER_USER/$DOCKER_REPO:$DISTRO |
| 40 | # example (and the default): |
| 41 | # apache/thrift:ubuntu-xenial |
| 42 | # |
| 43 | |
Henrique Mendonça | aba4b1f | 2015-06-26 20:56:18 +1000 | [diff] [blame] | 44 | sudo: required |
Nobuaki Sukegawa | d479e23 | 2016-02-28 11:28:19 +0900 | [diff] [blame] | 45 | dist: trusty |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 46 | language: cpp |
Henrique Mendonça | aba4b1f | 2015-06-26 20:56:18 +1000 | [diff] [blame] | 47 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 48 | services: |
| 49 | - docker |
Roger Meier | a0836f6 | 2013-05-05 00:19:38 +0200 | [diff] [blame] | 50 | |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 51 | install: |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 52 | - if [[ `uname` == "Linux" ]]; then build/docker/refresh.sh; fi |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 53 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 54 | stages: |
| 55 | # - osx # up front for now (for testing) |
| 56 | - docker # docker images |
| 57 | - thrift # thrift build jobs |
Roger Meier | 7ed94ef | 2015-04-26 16:55:35 +0200 | [diff] [blame] | 58 | |
henrique | ac8d8e2 | 2014-07-23 23:31:04 +0200 | [diff] [blame] | 59 | env: |
Roger Meier | 5effab6 | 2014-11-16 22:31:33 +0100 | [diff] [blame] | 60 | global: |
Nobuaki Sukegawa | 93fb7ea | 2016-09-04 17:00:11 +0900 | [diff] [blame] | 61 | - SCRIPT="cmake.sh" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 62 | - BUILD_ARG="" |
| 63 | - BUILD_ENV="-e CC=clang -e CXX=clang++" |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 64 | - DISTRO=ubuntu-xenial |
Nobuaki Sukegawa | c40018b | 2016-02-22 21:29:13 +0900 | [diff] [blame] | 65 | - BUILD_LIBS="CPP C_GLIB HASKELL JAVA PYTHON TESTING TUTORIALS" # only meaningful for CMake builds |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 66 | - TRAVIS_BUILD_STAGE=test |
| 67 | - DEFAULT_DOCKER_USER="apache" |
| 68 | - DEFAULT_DOCKER_REPO="thrift" |
henrique | c0a7d72 | 2014-07-26 13:11:12 +0200 | [diff] [blame] | 69 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 70 | jobs: |
| 71 | include: |
| 72 | # ------------------------- phase: osx -------------------------- |
| 73 | # - stage: osx |
| 74 | # os: osx |
| 75 | # osx_image: xcode9 |
| 76 | # script: build/docker/scripts/autotools.sh |
James E. King, III | 81cdcd3 | 2017-09-09 17:54:10 +0000 | [diff] [blame] | 77 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 78 | # ========================= stage: docker ========================= |
| 79 | - stage: docker |
| 80 | script: true |
| 81 | env: |
| 82 | - JOB="Docker Build ubuntu-trusty 14.04" |
| 83 | - DISTRO=ubuntu-trusty |
| 84 | - TRAVIS_BUILD_STAGE=docker |
| 85 | - script: true |
| 86 | env: |
| 87 | - JOB="Docker Build ubuntu-xenial 16.04" |
| 88 | - DISTRO=ubuntu-xenial |
| 89 | - TRAVIS_BUILD_STAGE=docker |
| 90 | - script: true |
| 91 | env: |
| 92 | - JOB="Docker Build ubuntu-artful 17.10" |
| 93 | - DISTRO=ubuntu-artful |
| 94 | - TRAVIS_BUILD_STAGE=docker |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 95 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 96 | # ========================= stage: thrift ======================= |
| 97 | # ------------------------- phase: cross ------------------------ |
| 98 | # apache/thrift official PR builds can exceed 50 minutes per job so combine all cross tests |
| 99 | - stage: thrift |
| 100 | script: build/docker/run.sh |
| 101 | if: repo = apache/thrift |
| 102 | env: |
| 103 | - JOB="Cross Language Tests" |
| 104 | - SCRIPT="cross-test.sh" |
| 105 | - BUILD_ARG="" |
| 106 | - BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4" |
Allen George | bc1344d | 2017-04-28 10:22:03 -0400 | [diff] [blame] | 107 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 108 | # fork based PR builds cannot exceed 50 minutes per job |
| 109 | - stage: thrift |
| 110 | script: build/docker/run.sh |
| 111 | if: repo != apache/thrift |
| 112 | env: |
| 113 | - JOB="Cross Language Tests (Binary Protocol)" |
| 114 | - SCRIPT="cross-test.sh" |
| 115 | - BUILD_ARG="-'(binary)'" |
| 116 | - BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4" |
James E. King, III | 65efdff | 2017-09-25 00:13:38 -0400 | [diff] [blame] | 117 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 118 | - stage: thrift |
| 119 | script: build/docker/run.sh |
| 120 | if: repo != apache/thrift |
| 121 | env: |
| 122 | - JOB="Cross Language Tests (Header, JSON Protocols)" |
| 123 | - SCRIPT="cross-test.sh" |
| 124 | - BUILD_ARG="-'(header|json)'" |
| 125 | - BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 126 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 127 | - stage: thrift |
| 128 | script: build/docker/run.sh |
| 129 | if: repo != apache/thrift |
| 130 | env: |
| 131 | - JOB="Cross Language Tests (Compact and Multiplexed Protocols)" |
| 132 | - SCRIPT="cross-test.sh" |
| 133 | - BUILD_ARG="-'(compact|multiplexed)'" |
| 134 | - BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4" |
Nobuaki Sukegawa | e58ed1a | 2015-11-23 19:23:43 +0900 | [diff] [blame] | 135 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 136 | # ------------------------- phase: sca -------------------------- |
| 137 | # QA jobs for code analytics and metrics |
| 138 | - stage: thrift |
| 139 | script: build/docker/run.sh |
| 140 | env: |
| 141 | - JOB="Static Code Analysis" |
| 142 | - SCRIPT="sca.sh" |
| 143 | - DISTRO=ubuntu-artful |
James E. King, III | 65efdff | 2017-09-25 00:13:38 -0400 | [diff] [blame] | 144 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 145 | # C and C++ undefined behavior. |
| 146 | # A binary crashes if undefined behavior occurs and produces a stack trace. |
| 147 | # python is disabled, see: THRIFT-4360 |
| 148 | - script: build/docker/run.sh |
| 149 | env: |
| 150 | - JOB="UBSan" |
| 151 | - SCRIPT="ubsan.sh" |
| 152 | - DISTRO=ubuntu-artful |
| 153 | - BUILD_ARG="--without-python --without-py3" |
Roger Meier | 447294f | 2015-12-11 00:04:41 +0100 | [diff] [blame] | 154 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 155 | # ------------------------- phase: cmake ------------------------ |
| 156 | - script: build/docker/run.sh |
| 157 | env: |
| 158 | - JOB="CMake (Ubuntu Xenial)" |
Nobuaki Sukegawa | a10697a | 2014-12-21 19:43:22 +0900 | [diff] [blame] | 159 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 160 | # C++ specific options: compiler plug-in, threading model |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 161 | - script: build/docker/run.sh |
| 162 | env: |
| 163 | - JOB="C++98 (Boost Thread)" |
| 164 | - SCRIPT="cmake.sh" |
| 165 | - BUILD_LIBS="CPP TESTING TUTORIALS" |
| 166 | - BUILD_ARG="-DCMAKE_CXX_STANDARD=98 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF --DWITH_BOOSTTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" |
| 167 | - BUILD_ENV="" |
James E. King, III | 65efdff | 2017-09-25 00:13:38 -0400 | [diff] [blame] | 168 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 169 | - script: build/docker/run.sh |
| 170 | env: |
| 171 | - JOB="C++ (Std Thread) and Plugin" |
| 172 | - SCRIPT="cmake.sh" |
| 173 | - BUILD_LIBS="CPP TESTING TUTORIALS" |
| 174 | - BUILD_ARG="-DWITH_PLUGIN=ON -DWITH_STDTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF" |
| 175 | - BUILD_ENV="-e CC=clang -e CXX=clang++" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 176 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 177 | # ------------------------- phase: autotools -------------------- |
| 178 | # TODO: Remove them once migrated to CMake |
| 179 | - script: build/docker/run.sh |
| 180 | env: |
| 181 | - JOB="Autotools (Ubuntu Artful)" |
| 182 | - DISTRO=ubuntu-artful |
| 183 | - SCRIPT="autotools.sh" |
| 184 | - BUILD_ENV="-e CC=gcc -e CXX=g++" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 185 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 186 | - script: build/docker/run.sh |
| 187 | env: |
| 188 | - JOB="Autotools (Ubuntu Xenial)" |
| 189 | - DISTRO=ubuntu-xenial |
| 190 | - SCRIPT="autotools.sh" |
| 191 | - BUILD_ENV="-e CC=gcc -e CXX=g++" |
James E. King, III | 65efdff | 2017-09-25 00:13:38 -0400 | [diff] [blame] | 192 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 193 | - script: build/docker/run.sh |
| 194 | env: |
| 195 | - JOB="Autotools (Ubuntu Trusty)" |
| 196 | - DISTRO=ubuntu-trusty |
| 197 | - SCRIPT="autotools.sh" |
| 198 | - BUILD_ENV="-e CC=gcc -e CXX=g++" |
Nobuaki Sukegawa | a6ab1f5 | 2015-11-28 15:04:39 +0900 | [diff] [blame] | 199 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 200 | # ------------------------- phase: dist ------------------------- |
| 201 | - script: build/docker/run.sh |
| 202 | env: |
| 203 | - JOB="make dist" |
| 204 | - SCRIPT="make-dist.sh" |
| 205 | - BUILD_ENV="-e CC=gcc -e CXX=g++" |
Roger Meier | 447294f | 2015-12-11 00:04:41 +0100 | [diff] [blame] | 206 | |
James E. King, III | 0ad20bd | 2017-09-30 15:44:16 -0700 | [diff] [blame] | 207 | - script: build/docker/run.sh |
| 208 | env: |
| 209 | - JOB="Debian Packages" |
| 210 | - SCRIPT="dpkg.sh" |
| 211 | - BUILD_ENV="-e CC=gcc -e CXX=g++" |