summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 0f9500c6ea50977fb93b12ac8a3ff6a3ad7f2dfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

# build Apache Thrift on Travis CI - https://travis-ci.org/

#
# Docker Integration
# 
# DOCKER_REPO
#   [required] The repository name (within your account).
# DOCKER_PASS
#   [optional, secure] Your docker account password.
#   If you do not set this, each build job in the "test"
#   stage might rebuild the docker image and extend build
#   time by about 10 minutes per job.  If you do set this
#   then each build job in the "docker" stage" will build
#   the docker image if Dockerfile has changed, and then
#   push the new tag up to your docker hub account.
# DOCKER_USER
#   [required] Your docker hub account name.
#
# The resulting tag is:
#   $DOCKER_USER/$DOCKER_REPO:$DISTRO
# example (and the default):
#   apache/thrift:ubuntu-xenial
#

sudo: required
dist: trusty
language: cpp

services:
  - docker

install:
  - if [[ `uname` == "Linux" ]]; then build/docker/refresh.sh; fi

stages:
# - osx       # up front for now (for testing)
  - docker    # docker images
  - thrift    # thrift build jobs

env:
  global:
    - SCRIPT="cmake.sh"
    - BUILD_ARG=""
    - BUILD_ENV="-e CC=clang -e CXX=clang++"
    - DISTRO=ubuntu-xenial
    - BUILD_LIBS="CPP C_GLIB HASKELL JAVA PYTHON TESTING TUTORIALS"  # only meaningful for CMake builds
    - TRAVIS_BUILD_STAGE=test
    - DEFAULT_DOCKER_USER="apache"
    - DEFAULT_DOCKER_REPO="thrift"

jobs:
  include:
    # ------------------------- phase: osx --------------------------
    # - stage: osx
    #   os: osx
    #   osx_image: xcode9
    #   script: build/docker/scripts/autotools.sh

    # ========================= stage: docker =========================
    - stage: docker
      script: true
      env:
        - JOB="Docker Build ubuntu-trusty 14.04"
        - DISTRO=ubuntu-trusty
        - TRAVIS_BUILD_STAGE=docker
    - script: true
      env:
        - JOB="Docker Build ubuntu-xenial 16.04"
        - DISTRO=ubuntu-xenial
        - TRAVIS_BUILD_STAGE=docker
    - script: true
      env:
        - JOB="Docker Build ubuntu-artful 17.10"
        - DISTRO=ubuntu-artful
        - TRAVIS_BUILD_STAGE=docker

    # ========================= stage: thrift =======================
    # ------------------------- phase: cross ------------------------
    # apache/thrift official PR builds can exceed 50 minutes per job so combine all cross tests
    - stage: thrift
      script: build/docker/run.sh
      if: repo = apache/thrift
      env:
        - JOB="Cross Language Tests"
        - SCRIPT="cross-test.sh"
        - BUILD_ARG=""
        - BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"

    # fork based PR builds cannot exceed 50 minutes per job
    - stage: thrift
      script: build/docker/run.sh
      if: repo != apache/thrift
      env:
        - JOB="Cross Language Tests (Binary Protocol)"
        - SCRIPT="cross-test.sh"
        - BUILD_ARG="-'(binary)'"
        - BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"

    - stage: thrift
      script: build/docker/run.sh
      if: repo != apache/thrift
      env:
        - JOB="Cross Language Tests (Header, JSON Protocols)"
        - SCRIPT="cross-test.sh"
        - BUILD_ARG="-'(header|json)'"
        - BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"

    - stage: thrift
      script: build/docker/run.sh
      if: repo != apache/thrift
      env:
        - JOB="Cross Language Tests (Compact and Multiplexed Protocols)"
        - SCRIPT="cross-test.sh"
        - BUILD_ARG="-'(compact|multiplexed)'"
        - BUILD_ENV="-e CC=clang -e CXX=clang++ -e THRIFT_CROSSTEST_CONCURRENCY=4"

    # ------------------------- phase: sca --------------------------
    # QA jobs for code analytics and metrics
    - stage: thrift
      script: build/docker/run.sh
      env:
        - JOB="Static Code Analysis"
        - SCRIPT="sca.sh"
        - DISTRO=ubuntu-artful

    # C and C++ undefined behavior.
    # A binary crashes if undefined behavior occurs and produces a stack trace.
    # python is disabled, see: THRIFT-4360
    - script: build/docker/run.sh
      env:
        - JOB="UBSan"
        - SCRIPT="ubsan.sh"
        - DISTRO=ubuntu-artful
        - BUILD_ARG="--without-python --without-py3"

    # ------------------------- phase: cmake ------------------------
    - script: build/docker/run.sh
      env:
        - JOB="CMake (Ubuntu Xenial)"

    # C++ specific options: compiler plug-in, threading model
    - script: build/docker/run.sh
      env:
        - JOB="C++98 (Boost Thread)"
        - SCRIPT="cmake.sh"
        - BUILD_LIBS="CPP TESTING TUTORIALS"
        - 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"
        - BUILD_ENV=""

    - script: build/docker/run.sh
      env:
        - JOB="C++ (Std Thread) and Plugin"
        - SCRIPT="cmake.sh"
        - BUILD_LIBS="CPP TESTING TUTORIALS"
        - BUILD_ARG="-DWITH_PLUGIN=ON -DWITH_STDTHREADS=ON -DWITH_PYTHON=OFF -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_HASKELL=OFF"
        - BUILD_ENV="-e CC=clang -e CXX=clang++"

    # ------------------------- phase: autotools --------------------
    # TODO: Remove them once migrated to CMake
    - script: build/docker/run.sh
      env:
        - JOB="Autotools (Ubuntu Artful)"
        - DISTRO=ubuntu-artful
        - SCRIPT="autotools.sh"
        - BUILD_ENV="-e CC=gcc -e CXX=g++"

    - script: build/docker/run.sh
      env:
        - JOB="Autotools (Ubuntu Xenial)"
        - DISTRO=ubuntu-xenial
        - SCRIPT="autotools.sh"
        - BUILD_ENV="-e CC=gcc -e CXX=g++"

    - script: build/docker/run.sh
      env:
        - JOB="Autotools (Ubuntu Trusty)"
        - DISTRO=ubuntu-trusty
        - SCRIPT="autotools.sh"
        - BUILD_ENV="-e CC=gcc -e CXX=g++"

    # ------------------------- phase: dist -------------------------
    - script: build/docker/run.sh
      env:
        - JOB="make dist"
        - SCRIPT="make-dist.sh"
        - BUILD_ENV="-e CC=gcc -e CXX=g++"

    - script: build/docker/run.sh
      env:
        - JOB="Debian Packages"
        - SCRIPT="dpkg.sh"
        - BUILD_ENV="-e CC=gcc -e CXX=g++"