blob: 0f9500c6ea50977fb93b12ac8a3ff6a3ad7f2dfc [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
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çaaba4b1f2015-06-26 20:56:18 +100044sudo: required
Nobuaki Sukegawad479e232016-02-28 11:28:19 +090045dist: trusty
James E. King, III0ad20bd2017-09-30 15:44:16 -070046language: cpp
Henrique Mendonçaaba4b1f2015-06-26 20:56:18 +100047
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090048services:
49 - docker
Roger Meiera0836f62013-05-05 00:19:38 +020050
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090051install:
James E. King, III0ad20bd2017-09-30 15:44:16 -070052 - if [[ `uname` == "Linux" ]]; then build/docker/refresh.sh; fi
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +090053
James E. King, III0ad20bd2017-09-30 15:44:16 -070054stages:
55# - osx # up front for now (for testing)
56 - docker # docker images
57 - thrift # thrift build jobs
Roger Meier7ed94ef2015-04-26 16:55:35 +020058
henriqueac8d8e22014-07-23 23:31:04 +020059env:
Roger Meier5effab62014-11-16 22:31:33 +010060 global:
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090061 - SCRIPT="cmake.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090062 - BUILD_ARG=""
63 - BUILD_ENV="-e CC=clang -e CXX=clang++"
James E. King, IIId7142b72017-09-01 13:00:36 -070064 - DISTRO=ubuntu-xenial
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090065 - BUILD_LIBS="CPP C_GLIB HASKELL JAVA PYTHON TESTING TUTORIALS" # only meaningful for CMake builds
James E. King, III0ad20bd2017-09-30 15:44:16 -070066 - TRAVIS_BUILD_STAGE=test
67 - DEFAULT_DOCKER_USER="apache"
68 - DEFAULT_DOCKER_REPO="thrift"
henriquec0a7d722014-07-26 13:11:12 +020069
James E. King, III0ad20bd2017-09-30 15:44:16 -070070jobs:
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, III81cdcd32017-09-09 17:54:10 +000077
James E. King, III0ad20bd2017-09-30 15:44:16 -070078 # ========================= 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 Meier41ad4342015-03-24 22:30:40 +010095
James E. King, III0ad20bd2017-09-30 15:44:16 -070096 # ========================= 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 Georgebc1344d2017-04-28 10:22:03 -0400107
James E. King, III0ad20bd2017-09-30 15:44:16 -0700108 # 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, III65efdff2017-09-25 00:13:38 -0400117
James E. King, III0ad20bd2017-09-30 15:44:16 -0700118 - 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 Sukegawae58ed1a2015-11-23 19:23:43 +0900126
James E. King, III0ad20bd2017-09-30 15:44:16 -0700127 - 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 Sukegawae58ed1a2015-11-23 19:23:43 +0900135
James E. King, III0ad20bd2017-09-30 15:44:16 -0700136 # ------------------------- 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, III65efdff2017-09-25 00:13:38 -0400144
James E. King, III0ad20bd2017-09-30 15:44:16 -0700145 # 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 Meier447294f2015-12-11 00:04:41 +0100154
James E. King, III0ad20bd2017-09-30 15:44:16 -0700155 # ------------------------- phase: cmake ------------------------
156 - script: build/docker/run.sh
157 env:
158 - JOB="CMake (Ubuntu Xenial)"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900159
James E. King, IIId7142b72017-09-01 13:00:36 -0700160 # C++ specific options: compiler plug-in, threading model
James E. King, III0ad20bd2017-09-30 15:44:16 -0700161 - 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, III65efdff2017-09-25 00:13:38 -0400168
James E. King, III0ad20bd2017-09-30 15:44:16 -0700169 - 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 Sukegawaa6ab1f52015-11-28 15:04:39 +0900176
James E. King, III0ad20bd2017-09-30 15:44:16 -0700177 # ------------------------- 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 Sukegawaa6ab1f52015-11-28 15:04:39 +0900185
James E. King, III0ad20bd2017-09-30 15:44:16 -0700186 - 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, III65efdff2017-09-25 00:13:38 -0400192
James E. King, III0ad20bd2017-09-30 15:44:16 -0700193 - 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 Sukegawaa6ab1f52015-11-28 15:04:39 +0900199
James E. King, III0ad20bd2017-09-30 15:44:16 -0700200 # ------------------------- 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 Meier447294f2015-12-11 00:04:41 +0100206
James E. King, III0ad20bd2017-09-30 15:44:16 -0700207 - script: build/docker/run.sh
208 env:
209 - JOB="Debian Packages"
210 - SCRIPT="dpkg.sh"
211 - BUILD_ENV="-e CC=gcc -e CXX=g++"