blob: 9a94e3649376811c024a7c94bd76c967d3d2eb7f [file] [log] [blame]
Roger Meiera0836f62013-05-05 00:19:38 +02001#
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, III0ad20bd2017-09-30 15:44:16 -070022#
23# Docker Integration
James E. King, IIIcd5be7b2017-10-21 10:16:19 -040024# see: build/docker/README.md
James E. King, III0ad20bd2017-09-30 15:44:16 -070025#
James E. King, III0ad20bd2017-09-30 15:44:16 -070026
Henrique Mendonçaaba4b1f2015-06-26 20:56:18 +100027sudo: required
Nobuaki Sukegawad479e232016-02-28 11:28:19 +090028dist: trusty
James E. King, III0ad20bd2017-09-30 15:44:16 -070029language: cpp
Henrique Mendonçaaba4b1f2015-06-26 20:56:18 +100030
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090031services:
32 - docker
Roger Meiera0836f62013-05-05 00:19:38 +020033
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090034install:
James E. King, III0ad20bd2017-09-30 15:44:16 -070035 - if [[ `uname` == "Linux" ]]; then build/docker/refresh.sh; fi
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090036
James E. King, III0ad20bd2017-09-30 15:44:16 -070037stages:
38# - osx # up front for now (for testing)
39 - docker # docker images
40 - thrift # thrift build jobs
Roger Meier7ed94ef2015-04-26 16:55:35 +020041
henriqueac8d8e22014-07-23 23:31:04 +020042env:
Roger Meier5effab62014-11-16 22:31:33 +010043 global:
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090044 - SCRIPT="cmake.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090045 - BUILD_ARG=""
46 - BUILD_ENV="-e CC=clang -e CXX=clang++"
James E. King, IIId7142b72017-09-01 13:00:36 -070047 - DISTRO=ubuntu-xenial
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090048 - BUILD_LIBS="CPP C_GLIB HASKELL JAVA PYTHON TESTING TUTORIALS" # only meaningful for CMake builds
James E. King, III0ad20bd2017-09-30 15:44:16 -070049 - TRAVIS_BUILD_STAGE=test
James E. King, IIIcd5be7b2017-10-21 10:16:19 -040050 # DOCKER_REPO (this works for all builds as a source for docker images - you can override for fork builds in your Travis settings)
51 - DOCKER_REPO="thrift/thrift-build"
52 # DOCKER_USER (provide in your Travis settings if you want to build and update docker images once, instead of on every job)
53 # DOCKER_PASS (same)
henriquec0a7d722014-07-26 13:11:12 +020054
James E. King, III0ad20bd2017-09-30 15:44:16 -070055jobs:
56 include:
57 # ------------------------- phase: osx --------------------------
58 # - stage: osx
59 # os: osx
60 # osx_image: xcode9
61 # script: build/docker/scripts/autotools.sh
James E. King, III81cdcd32017-09-09 17:54:10 +000062
James E. King, III0ad20bd2017-09-30 15:44:16 -070063 # ========================= stage: docker =========================
64 - stage: docker
65 script: true
66 env:
67 - JOB="Docker Build ubuntu-trusty 14.04"
68 - DISTRO=ubuntu-trusty
69 - TRAVIS_BUILD_STAGE=docker
70 - script: true
71 env:
72 - JOB="Docker Build ubuntu-xenial 16.04"
73 - DISTRO=ubuntu-xenial
74 - TRAVIS_BUILD_STAGE=docker
75 - script: true
76 env:
77 - JOB="Docker Build ubuntu-artful 17.10"
78 - DISTRO=ubuntu-artful
79 - TRAVIS_BUILD_STAGE=docker
Roger Meier41ad4342015-03-24 22:30:40 +010080
James E. King, III0ad20bd2017-09-30 15:44:16 -070081 # ========================= stage: thrift =======================
82 # ------------------------- phase: cross ------------------------
83 # apache/thrift official PR builds can exceed 50 minutes per job so combine all cross tests
84 - stage: thrift
85 script: build/docker/run.sh
86 if: repo = apache/thrift
87 env:
88 - JOB="Cross Language Tests"
89 - SCRIPT="cross-test.sh"
90 - BUILD_ARG=""
91 - BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
Allen Georgebc1344d2017-04-28 10:22:03 -040092
James E. King, III0ad20bd2017-09-30 15:44:16 -070093 # fork based PR builds cannot exceed 50 minutes per job
94 - stage: thrift
95 script: build/docker/run.sh
96 if: repo != apache/thrift
97 env:
98 - JOB="Cross Language Tests (Binary Protocol)"
99 - SCRIPT="cross-test.sh"
100 - BUILD_ARG="-'(binary)'"
101 - BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
James E. King, III65efdff2017-09-25 00:13:38 -0400102
James E. King, III0ad20bd2017-09-30 15:44:16 -0700103 - stage: thrift
104 script: build/docker/run.sh
105 if: repo != apache/thrift
106 env:
107 - JOB="Cross Language Tests (Header, JSON Protocols)"
108 - SCRIPT="cross-test.sh"
109 - BUILD_ARG="-'(header|json)'"
110 - BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900111
James E. King, III0ad20bd2017-09-30 15:44:16 -0700112 - stage: thrift
113 script: build/docker/run.sh
114 if: repo != apache/thrift
115 env:
116 - JOB="Cross Language Tests (Compact and Multiplexed Protocols)"
117 - SCRIPT="cross-test.sh"
118 - BUILD_ARG="-'(compact|multiplexed)'"
119 - BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900120
James E. King, III0ad20bd2017-09-30 15:44:16 -0700121 # ------------------------- phase: sca --------------------------
122 # QA jobs for code analytics and metrics
123 - stage: thrift
124 script: build/docker/run.sh
125 env:
126 - JOB="Static Code Analysis"
127 - SCRIPT="sca.sh"
128 - DISTRO=ubuntu-artful
James E. King, III65efdff2017-09-25 00:13:38 -0400129
James E. King, III0ad20bd2017-09-30 15:44:16 -0700130 # C and C++ undefined behavior.
131 # A binary crashes if undefined behavior occurs and produces a stack trace.
132 # python is disabled, see: THRIFT-4360
133 - script: build/docker/run.sh
134 env:
135 - JOB="UBSan"
136 - SCRIPT="ubsan.sh"
137 - DISTRO=ubuntu-artful
138 - BUILD_ARG="--without-python --without-py3"
Roger Meier447294f2015-12-11 00:04:41 +0100139
James E. King, III0ad20bd2017-09-30 15:44:16 -0700140 # ------------------------- phase: cmake ------------------------
141 - script: build/docker/run.sh
142 env:
143 - JOB="CMake (Ubuntu Xenial)"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900144
James E. King, IIId7142b72017-09-01 13:00:36 -0700145 # C++ specific options: compiler plug-in, threading model
James E. King, III0ad20bd2017-09-30 15:44:16 -0700146 - script: build/docker/run.sh
147 env:
148 - JOB="C++98 (Boost Thread)"
149 - SCRIPT="cmake.sh"
150 - BUILD_LIBS="CPP TESTING TUTORIALS"
151 - 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"
152 - BUILD_ENV=""
James E. King, III65efdff2017-09-25 00:13:38 -0400153
James E. King, III0ad20bd2017-09-30 15:44:16 -0700154 - script: build/docker/run.sh
155 env:
156 - JOB="C++ (Std Thread) and Plugin"
157 - SCRIPT="cmake.sh"
158 - BUILD_LIBS="CPP TESTING TUTORIALS"
159 - BUILD_ARG="-DWITH_PLUGIN=ON -DWITH_STDTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
160 - BUILD_ENV="-e CC=clang -e CXX=clang++"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900161
James E. King, III0ad20bd2017-09-30 15:44:16 -0700162 # ------------------------- phase: autotools --------------------
163 # TODO: Remove them once migrated to CMake
164 - script: build/docker/run.sh
165 env:
166 - JOB="Autotools (Ubuntu Artful)"
167 - DISTRO=ubuntu-artful
168 - SCRIPT="autotools.sh"
169 - BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900170
James E. King, III0ad20bd2017-09-30 15:44:16 -0700171 - script: build/docker/run.sh
172 env:
173 - JOB="Autotools (Ubuntu Xenial)"
174 - DISTRO=ubuntu-xenial
175 - SCRIPT="autotools.sh"
176 - BUILD_ENV="-e CC=gcc -e CXX=g++"
James E. King, III65efdff2017-09-25 00:13:38 -0400177
James E. King, III0ad20bd2017-09-30 15:44:16 -0700178 - script: build/docker/run.sh
179 env:
180 - JOB="Autotools (Ubuntu Trusty)"
181 - DISTRO=ubuntu-trusty
182 - SCRIPT="autotools.sh"
183 - BUILD_ENV="-e CC=gcc -e CXX=g++"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900184
James E. King, III0ad20bd2017-09-30 15:44:16 -0700185 # ------------------------- phase: dist -------------------------
186 - script: build/docker/run.sh
187 env:
188 - JOB="make dist"
189 - SCRIPT="make-dist.sh"
190 - BUILD_ENV="-e CC=gcc -e CXX=g++"
Roger Meier447294f2015-12-11 00:04:41 +0100191
James E. King, III0ad20bd2017-09-30 15:44:16 -0700192 - script: build/docker/run.sh
193 env:
194 - JOB="Debian Packages"
195 - SCRIPT="dpkg.sh"
196 - BUILD_ENV="-e CC=gcc -e CXX=g++"