• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1env:
2  global:
3    # Set at the root level as this is ignored when set under matrix.env.
4    - GCC_VERSION="4.9"
5    # Fail on first error if UBSAN or ASAN enabled for a target
6    - UBSAN_OPTIONS=halt_on_error=1
7    - ASAN_OPTIONS=halt_on_error=1
8    # Travis machines have 2 cores
9    - JOBS=2
10    - MAKEFLAGS="-j 2"
11
12conan-linux: &conan-linux
13  os: linux
14  dist: xenial
15  language: python
16  python: "3.7"
17  services:
18    - docker
19  install:
20    - ./conan/travis/install.sh
21  script:
22    - ./conan/travis/build.sh
23  if: tag IS present
24
25conan-osx: &conan-osx
26  os: osx
27  language: generic
28  install:
29    - ./conan/travis/install.sh
30  script:
31    - ./conan/travis/build.sh
32  if: tag IS present
33
34matrix:
35  include:
36    #- language: python
37    #  python: "2.7"
38    #  install:
39    #    - "pip install wheel twine"
40    #  script:
41    #    - "cd python/"
42    #    - 'VERSION="$TRAVIS_TAG" python setup.py sdist bdist_wheel'
43    #    - "cd ../"
44    #  deploy:
45    #    # Checkpointed release builds.
46    #    - provider: script
47    #      script: .travis/deploy-python.sh
48    #      skip_cleanup: true
49    #      on:
50    #        tags: true
51    #        # all_branches must be set with tags: true. See below post:
52    #        # https://stackoverflow.com/a/27775257/1076585
53    #        all_branches: true
54    #    # Produce a new build for the cutting edge when master changes.
55    #    - provider: script
56    #      script: .travis/deploy-python.sh
57    #      skip_cleanup: true
58    #      on:
59    #        branch: master
60    - language: cpp
61      os:
62        - linux
63
64      addons:
65        apt:
66          packages:
67            - docker-ce
68      script:
69        - bash .travis/build-and-run-docker-test-containers.sh
70
71    - language: cpp
72      os:
73        - linux
74
75      compiler:
76        - gcc
77
78      env:
79        matrix:
80          - BUILD_TYPE=Debug
81          - BUILD_TYPE=Release CONAN=true
82
83      before_install:
84      - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
85      - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi
86      - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq g++-$GCC_VERSION; fi
87      - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq gcc-$GCC_VERSION; fi
88      - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which g++-$GCC_VERSION) /usr/bin/g++; fi
89      - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which gcc-$GCC_VERSION) /usr/bin/gcc; fi
90
91      script:
92      - bash .travis/check-sources.sh
93      - bash grpc/build_grpc.sh
94      - cmake .
95        -DCMAKE_BUILD_TYPE=$BUILD_TYPE
96        -DFLATBUFFERS_BUILD_GRPCTEST=ON
97        -DGRPC_INSTALL_PATH=$TRAVIS_BUILD_DIR/google/grpc/install
98        -DPROTOBUF_DOWNLOAD_PATH=$TRAVIS_BUILD_DIR/google/grpc/third_party/protobuf
99        -DFLATBUFFERS_CODE_SANITIZE=ON
100      - cmake --build . -- -j${JOBS}
101      - LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/google/grpc/install/lib ctest --extra-verbose --output-on-failure
102      - bash .travis/check-generate-code.sh
103      - if [ "$CONAN" == "true" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo pip install conan && conan create . flatbuffers/${TRAVIS_BRANCH}@google/testing -s build_type=$BUILD_TYPE -tf conan/test_package; fi
104
105    - language: cpp
106      os: osx
107      osx_image: xcode9.3
108      env:
109        matrix:
110          - BUILD_TYPE=Debug
111          - BUILD_TYPE=Release
112
113      script:
114      - bash grpc/build_grpc.sh
115      - cmake .
116        -DCMAKE_BUILD_TYPE=$BUILD_TYPE
117        -DFLATBUFFERS_BUILD_GRPCTEST=ON
118        -DGRPC_INSTALL_PATH=$TRAVIS_BUILD_DIR/google/grpc/install
119        -DPROTOBUF_DOWNLOAD_PATH=$TRAVIS_BUILD_DIR/google/grpc/third_party/protobuf
120        -DFLATBUFFERS_CODE_SANITIZE=ON
121      - cmake --build . -- -j${JOBS}
122      - DYLD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/google/grpc/install/lib ctest --extra-verbose --output-on-failure
123      - bash .travis/check-generate-code.sh
124
125    - <<: *conan-linux
126      env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=conanio/gcc49
127    - <<: *conan-linux
128      env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=conanio/gcc5
129    - <<: *conan-linux
130      env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=conanio/gcc6
131    - <<: *conan-linux
132      env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=conanio/gcc7
133    - <<: *conan-linux
134      env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/gcc8
135    - <<: *conan-linux
136      env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=conanio/clang39
137    - <<: *conan-linux
138      env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=conanio/clang40
139    - <<: *conan-linux
140      env: CONAN_CLANG_VERSIONS=5.0 CONAN_DOCKER_IMAGE=conanio/clang50
141    - <<: *conan-linux
142      env: CONAN_CLANG_VERSIONS=6.0 CONAN_DOCKER_IMAGE=conanio/clang60
143    - <<: *conan-osx
144      osx_image: xcode7.3
145      env: CONAN_APPLE_CLANG_VERSIONS=7.3
146    - <<: *conan-osx
147      osx_image: xcode8.3
148      env: CONAN_APPLE_CLANG_VERSIONS=8.1
149    - <<: *conan-osx
150      osx_image: xcode9
151      env: CONAN_APPLE_CLANG_VERSIONS=9.0
152    - <<: *conan-osx
153      osx_image: xcode9.4
154      env: CONAN_APPLE_CLANG_VERSIONS=9.1
155    - <<: *conan-osx
156      osx_image: xcode10
157      env: CONAN_APPLE_CLANG_VERSIONS=10.0
158
159    - language: android
160      sudo: true
161      android:
162        components:
163          - tools
164          - platform-tools
165          - build-tools-25.0.2
166          - android-25
167          - extra-android-m2repository
168      compiler:
169        - gcc
170
171      before_install:
172        # Output something every 10 minutes or Travis kills the job
173        - while sleep 540; do echo "=====[ $SECONDS seconds still running ]====="; done &
174        - git clone https://github.com/urho3d/android-ndk.git $HOME/android-ndk-root
175        - export ANDROID_NDK_HOME=$HOME/android-ndk-root
176        # Setup environment for Linux build which is required to build the sample.
177        - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
178        - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi
179        - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq g++-$GCC_VERSION; fi
180        - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq gcc-$GCC_VERSION; fi
181        - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which g++-$GCC_VERSION) /usr/bin/g++; fi
182        - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which gcc-$GCC_VERSION) /usr/bin/gcc; fi
183      script:
184        - failed=0; for build_gradle in $(git ls-files | grep build.gradle); do ( cd "$(dirname "${build_gradle}")" && ./gradlew build ) || failed=1; done; exit $((failed))
185        # Kill the sleep loop
186        - kill %1
187