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.com/
21
22#
23# Docker Integration
24# see: build/docker/README.md
25#
26
27sudo: required
28# https://docs.travis-ci.com/user/reference/linux
29dist: focal
30language: cpp
31
32services:
33  - docker
34
35install:
36  # https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received
37  # adding `travis_wait` because kerl building in the docker file takes >10 min for building erlang
38  # without printing to stdout, resulting in build failures
39  - if [[ `uname` == "Linux" ]]; then travis_wait 40 build/docker/refresh.sh; fi
40
41stages:
42  - docker    # docker images
43  - thrift    # thrift build jobs
44
45env:
46  global:
47    - SCRIPT="cmake.sh"
48    - BUILD_ARG=""
49    - BUILD_ENV="-e CC=gcc -e CXX=g++ -e THRIFT_CROSSTEST_CONCURRENCY=4"
50    - DISTRO=ubuntu-bionic
51    - BUILD_LIBS="CPP C_GLIB JAVA PYTHON TESTING TUTORIALS"  # only meaningful for CMake builds
52    - TRAVIS_BUILD_STAGE=test
53    # DOCKER_REPO (this works for all builds as a source for docker images - you can override for fork builds in your Travis settings)
54    - DOCKER_REPO="thrift/thrift-build"
55    # DOCKER_USER (provide in your Travis settings if you want to build and update docker images once, instead of on every job)
56    # DOCKER_PASS (same)
57
58jobs:
59  include:
60    # ========================= stage: docker =========================
61    - stage: docker
62      script: true
63      env:
64        - JOB="Docker Build ubuntu-bionic 18.04 LTS"
65        - DISTRO=ubuntu-bionic
66        - TRAVIS_BUILD_STAGE=docker
67    - script: true
68      env:
69        - JOB="Docker Build ubuntu-focal 20.04 LTS"
70        - DISTRO=ubuntu-focal
71        - TRAVIS_BUILD_STAGE=docker
72    - script: true
73      env:
74        - JOB="Docker Build ubuntu-jammy 22.04 LTS"
75        - DISTRO=ubuntu-jammy
76        - TRAVIS_BUILD_STAGE=docker
77
78    # ========================= stage: thrift =======================
79    # ------------------------- phase: cross ------------------------
80    - stage: thrift
81      script: build/docker/run.sh
82      env:
83        - JOB="Cross Language Tests (Binary Protocol)"
84        - SCRIPT="cross-test.sh"
85        - BUILD_ARG="-'(binary)'"
86
87    - stage: thrift
88      script: build/docker/run.sh
89      env:
90        - JOB="Cross Language Tests (Header, JSON Protocols)"
91        - SCRIPT="cross-test.sh"
92        - BUILD_ARG="-'(header|json)'"
93
94    - stage: thrift
95      script: build/docker/run.sh
96      env:
97        - JOB="Cross Language Tests (Compact and Multiplexed Protocols)"
98        - SCRIPT="cross-test.sh"
99        - BUILD_ARG="-'(compact|multiplexed)'"
100
101    # ------------------------- phase: sca --------------------------
102    # QA jobs for code analytics and metrics
103    - stage: thrift
104      script: build/docker/run.sh
105      env:
106        - JOB="Static Code Analysis"
107        - SCRIPT="sca.sh"
108
109    # C and C++ undefined behavior.
110    # A binary crashes if undefined behavior occurs and produces a stack trace.
111    # python is disabled, see: THRIFT-4360
112    - script: build/docker/run.sh
113      env:
114        - JOB="UBSan"
115        - SCRIPT="ubsan.sh"
116        - BUILD_ARG="--without-python --without-py3"
117
118    # ------------------------- phase: autotools --------------------
119    # TODO: Remove them once migrated to CMake
120
121    # TODO fix the missing python2 deps or get rid of python2
122    # - script: build/docker/run.sh
123    #   env:
124    #     - JOB="Autotools (Ubuntu Jammy)"
125    #     - DISTRO=ubuntu-jammy
126    #     - SCRIPT="autotools.sh"
127
128    - script: build/docker/run.sh
129      env:
130        - JOB="Autotools (Ubuntu Focal)"
131        - DISTRO=ubuntu-focal
132        - SCRIPT="autotools.sh"
133
134    - script: build/docker/run.sh
135      env:
136        - JOB="Autotools (Ubuntu Bionic)"
137        - DISTRO=ubuntu-bionic
138        - SCRIPT="autotools.sh"
139
140    # ------------------------- phase: cmake ------------------------
141    - script: build/docker/run.sh
142      env:
143        - JOB="CMake"
144        - BUILD_ARG="-DCMAKE_BUILD_TYPE=Debug"
145
146    - script: build/docker/run.sh
147      env:
148        - JOB="CMake"
149        - BUILD_ARG="-DCMAKE_BUILD_TYPE=Release"
150
151    # ------------------------- phase: dist -------------------------
152    - script: build/docker/run.sh
153      env:
154        - JOB="make dist"
155        - SCRIPT="make-dist.sh"
156
157    - script: build/docker/run.sh
158      env:
159        - JOB="Debian Packages"
160        - SCRIPT="dpkg.sh"
161
162    # ------------------------- phase: coverity ---------------------
163    # We build the coverity scan build once monthly using a travis cron job
164    - if: (env(COVERITY_SCAN_NOTIFICATION_EMAIL) IS present) AND (branch IN (master)) AND (type IN (cron))
165      script: build/docker/run.sh
166      env:
167        - JOB="Coverity Scan"
168        - SCRIPT="covscan.sh"
169
170    # ------------------------- phase: swift ------------------------
171    # We lint the podspec
172    - os: osx
173      osx_image: xcode11.3
174      language: swift
175      script:
176        - gem update cocoapods
177        - pod lib lint --allow-warnings --swift-version=5.1
178      env:
179        - JOB="pod lib lint"
180
181  ### ------------------------- phase: osx --------------------------
182  # disabled due to the time delays it imposes on build jobs
183  # - os: osx
184  #   osx_image: xcode9
185  #   script: build/docker/scripts/autotools.sh
186
187