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