blob: 2816facc9d93a4e4ed3cec1f4d4e8795ba7aeaab [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:
James E. King, III0ad20bd2017-09-30 15:44:16 -070038 - docker # docker images
39 - thrift # thrift build jobs
Roger Meier7ed94ef2015-04-26 16:55:35 +020040
henriqueac8d8e22014-07-23 23:31:04 +020041env:
Roger Meier5effab62014-11-16 22:31:33 +010042 global:
Nobuaki Sukegawa93fb7ea2016-09-04 17:00:11 +090043 - SCRIPT="cmake.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +090044 - BUILD_ARG=""
James E. King IIId907cc92018-01-12 10:43:25 -050045 - BUILD_ENV="-e CC=gcc -e CXX=g++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
James E. King IIIbf7f76b2018-02-28 17:11:05 -050046 - DISTRO=ubuntu-artful
Nobuaki Sukegawac40018b2016-02-22 21:29:13 +090047 - BUILD_LIBS="CPP C_GLIB HASKELL JAVA PYTHON TESTING TUTORIALS" # only meaningful for CMake builds
James E. King, III0ad20bd2017-09-30 15:44:16 -070048 - TRAVIS_BUILD_STAGE=test
James E. King, IIIcd5be7b2017-10-21 10:16:19 -040049 # DOCKER_REPO (this works for all builds as a source for docker images - you can override for fork builds in your Travis settings)
50 - DOCKER_REPO="thrift/thrift-build"
51 # DOCKER_USER (provide in your Travis settings if you want to build and update docker images once, instead of on every job)
52 # DOCKER_PASS (same)
henriquec0a7d722014-07-26 13:11:12 +020053
James E. King, III0ad20bd2017-09-30 15:44:16 -070054jobs:
55 include:
James E. King, III0ad20bd2017-09-30 15:44:16 -070056 # ========================= stage: docker =========================
57 - stage: docker
58 script: true
59 env:
James E. King, III0ad20bd2017-09-30 15:44:16 -070060 - JOB="Docker Build ubuntu-xenial 16.04"
61 - DISTRO=ubuntu-xenial
62 - TRAVIS_BUILD_STAGE=docker
63 - script: true
64 env:
65 - JOB="Docker Build ubuntu-artful 17.10"
66 - DISTRO=ubuntu-artful
67 - TRAVIS_BUILD_STAGE=docker
Roger Meier41ad4342015-03-24 22:30:40 +010068
James E. King, III0ad20bd2017-09-30 15:44:16 -070069 # ========================= stage: thrift =======================
70 # ------------------------- phase: cross ------------------------
71 # apache/thrift official PR builds can exceed 50 minutes per job so combine all cross tests
72 - stage: thrift
73 script: build/docker/run.sh
74 if: repo = apache/thrift
75 env:
76 - JOB="Cross Language Tests"
77 - SCRIPT="cross-test.sh"
Allen Georgebc1344d2017-04-28 10:22:03 -040078
James E. King, III0ad20bd2017-09-30 15:44:16 -070079 # fork based PR builds cannot exceed 50 minutes per job
80 - stage: thrift
81 script: build/docker/run.sh
82 if: repo != apache/thrift
83 env:
84 - JOB="Cross Language Tests (Binary Protocol)"
85 - SCRIPT="cross-test.sh"
86 - BUILD_ARG="-'(binary)'"
James E. King, III65efdff2017-09-25 00:13:38 -040087
James E. King, III0ad20bd2017-09-30 15:44:16 -070088 - stage: thrift
89 script: build/docker/run.sh
90 if: repo != apache/thrift
91 env:
92 - JOB="Cross Language Tests (Header, JSON Protocols)"
93 - SCRIPT="cross-test.sh"
94 - BUILD_ARG="-'(header|json)'"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +090095
James E. King, III0ad20bd2017-09-30 15:44:16 -070096 - stage: thrift
97 script: build/docker/run.sh
98 if: repo != apache/thrift
99 env:
100 - JOB="Cross Language Tests (Compact and Multiplexed Protocols)"
101 - SCRIPT="cross-test.sh"
102 - BUILD_ARG="-'(compact|multiplexed)'"
Nobuaki Sukegawae58ed1a2015-11-23 19:23:43 +0900103
James E. King, III0ad20bd2017-09-30 15:44:16 -0700104 # ------------------------- phase: sca --------------------------
105 # QA jobs for code analytics and metrics
106 - stage: thrift
107 script: build/docker/run.sh
108 env:
109 - JOB="Static Code Analysis"
110 - SCRIPT="sca.sh"
James E. King, III65efdff2017-09-25 00:13:38 -0400111
James E. King, III0ad20bd2017-09-30 15:44:16 -0700112 # C and C++ undefined behavior.
113 # A binary crashes if undefined behavior occurs and produces a stack trace.
114 # python is disabled, see: THRIFT-4360
115 - script: build/docker/run.sh
116 env:
117 - JOB="UBSan"
118 - SCRIPT="ubsan.sh"
James E. King, III0ad20bd2017-09-30 15:44:16 -0700119 - BUILD_ARG="--without-python --without-py3"
Roger Meier447294f2015-12-11 00:04:41 +0100120
James E. King, III0ad20bd2017-09-30 15:44:16 -0700121 # ------------------------- phase: cmake ------------------------
122 - script: build/docker/run.sh
123 env:
James E. King IIIbf7f76b2018-02-28 17:11:05 -0500124 - JOB="CMake"
Nobuaki Sukegawaa10697a2014-12-21 19:43:22 +0900125
James E. King, IIId7142b72017-09-01 13:00:36 -0700126 # C++ specific options: compiler plug-in, threading model
James E. King, III0ad20bd2017-09-30 15:44:16 -0700127 - script: build/docker/run.sh
128 env:
129 - JOB="C++98 (Boost Thread)"
130 - SCRIPT="cmake.sh"
131 - BUILD_LIBS="CPP TESTING TUTORIALS"
132 - 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"
James E. King IIId907cc92018-01-12 10:43:25 -0500133 - BUILD_ENV="-e CC=clang -e CXX=clang++"
James E. King, III65efdff2017-09-25 00:13:38 -0400134
James E. King, III0ad20bd2017-09-30 15:44:16 -0700135 - script: build/docker/run.sh
136 env:
137 - JOB="C++ (Std Thread) and Plugin"
138 - SCRIPT="cmake.sh"
139 - BUILD_LIBS="CPP TESTING TUTORIALS"
140 - BUILD_ARG="-DWITH_PLUGIN=ON -DWITH_STDTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
141 - BUILD_ENV="-e CC=clang -e CXX=clang++"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900142
James E. King, III0ad20bd2017-09-30 15:44:16 -0700143 # ------------------------- phase: autotools --------------------
144 # TODO: Remove them once migrated to CMake
145 - script: build/docker/run.sh
146 env:
147 - JOB="Autotools (Ubuntu Artful)"
148 - DISTRO=ubuntu-artful
149 - SCRIPT="autotools.sh"
Nobuaki Sukegawaa6ab1f52015-11-28 15:04:39 +0900150
James E. King, III0ad20bd2017-09-30 15:44:16 -0700151 - script: build/docker/run.sh
152 env:
153 - JOB="Autotools (Ubuntu Xenial)"
154 - DISTRO=ubuntu-xenial
155 - SCRIPT="autotools.sh"
James E. King, III65efdff2017-09-25 00:13:38 -0400156
James E. King, III0ad20bd2017-09-30 15:44:16 -0700157 # ------------------------- phase: dist -------------------------
158 - script: build/docker/run.sh
159 env:
160 - JOB="make dist"
James E. King IIIbf7f76b2018-02-28 17:11:05 -0500161 - DISTRO=ubuntu-xenial
James E. King, III0ad20bd2017-09-30 15:44:16 -0700162 - SCRIPT="make-dist.sh"
Roger Meier447294f2015-12-11 00:04:41 +0100163
James E. King, III0ad20bd2017-09-30 15:44:16 -0700164 - script: build/docker/run.sh
165 env:
166 - JOB="Debian Packages"
James E. King IIIbf7f76b2018-02-28 17:11:05 -0500167 - DISTRO=ubuntu-xenial
James E. King, III0ad20bd2017-09-30 15:44:16 -0700168 - SCRIPT="dpkg.sh"
James E. King IIId907cc92018-01-12 10:43:25 -0500169
James E. King IIIbf7f76b2018-02-28 17:11:05 -0500170 ### ------------------------- phase: osx -------------------------
171 # disabled due to the time delays it imposes on build jobs
172 # - os: osx
173 # osx_image: xcode9
174 # script: build/docker/scripts/autotools.sh
175