Turn on gRPC tests in travis build (#4955)
[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
6 conan-linux: &conan-linux
7   os: linux
8   sudo: required
9   language: python
10   python: "3.6"
11   services:
12     - docker
13   install:
14     - ./conan/travis/install.sh
15   script:
16     - ./conan/travis/build.sh
17   if: tag IS present
18
19 conan-osx: &conan-osx
20   os: osx
21   language: generic
22   install:
23     - ./conan/travis/install.sh
24   script:
25     - ./conan/travis/build.sh
26   if: tag IS present
27
28 matrix:
29   include:
30     #- language: python
31     #  python: "2.7"
32     #  install:
33     #    - "pip install wheel twine"
34     #  script:
35     #    - "cd python/"
36     #    - 'VERSION="$TRAVIS_TAG" python setup.py sdist bdist_wheel'
37     #    - "cd ../"
38     #  deploy:
39     #    # Checkpointed release builds.
40     #    - provider: script
41     #      script: .travis/deploy-python.sh
42     #      skip_cleanup: true
43     #      on:
44     #        tags: true
45     #        # all_branches must be set with tags: true. See below post:
46     #        # https://stackoverflow.com/a/27775257/1076585
47     #        all_branches: true
48     #    # Produce a new build for the cutting edge when master changes.
49     #    - provider: script
50     #      script: .travis/deploy-python.sh
51     #      skip_cleanup: true
52     #      on:
53     #        branch: master
54     - language: cpp
55       os:
56       - linux
57
58       compiler:
59         - gcc
60
61       env:
62         matrix:
63           - BUILD_TYPE=Debug
64           - BUILD_TYPE=Release CONAN=true
65
66       before_install:
67       - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
68       - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi
69       - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq g++-$GCC_VERSION; fi
70       - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq gcc-$GCC_VERSION; fi
71       - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which g++-$GCC_VERSION) /usr/bin/g++; fi
72       - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which gcc-$GCC_VERSION) /usr/bin/gcc; fi
73
74       script:
75       - bash grpc/build_grpc.sh
76       - cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DFLATBUFFERS_BUILD_GRPCTEST=ON -DGRPC_INSTALL_PATH=$TRAVIS_BUILD_DIR/google/grpc/install -DPROTOBUF_DOWNLOAD_PATH=$TRAVIS_BUILD_DIR/google/grpc/third_party/protobuf . && make
77       - LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/google/grpc/install/lib make test ARGS=-V
78       - if [ "$CONAN" == "true" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo pip install conan && conan create . google/testing -s build_type=$BUILD_TYPE -tf conan/test_package; fi
79
80     - language: cpp
81       os: osx
82       osx_image: xcode9.3
83       env:
84         matrix:
85           - BUILD_TYPE=Debug
86           - BUILD_TYPE=Release
87       script:
88       - bash grpc/build_grpc.sh
89       - cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DFLATBUFFERS_BUILD_GRPCTEST=ON -DGRPC_INSTALL_PATH=$TRAVIS_BUILD_DIR/google/grpc/install -DPROTOBUF_DOWNLOAD_PATH=$TRAVIS_BUILD_DIR/google/grpc/third_party/protobuf . && make
90       - ./flattests
91       - DYLD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/google/grpc/install/lib ./grpctest
92
93     - <<: *conan-linux
94       env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=lasote/conangcc49
95     - <<: *conan-linux
96       env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=lasote/conangcc5
97     - <<: *conan-linux
98       env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=lasote/conangcc6
99     - <<: *conan-linux
100       env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=lasote/conangcc7
101     - <<: *conan-linux
102       env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=lasote/conangcc8
103     - <<: *conan-linux
104       env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=lasote/conanclang39
105     - <<: *conan-linux
106       env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=lasote/conanclang40
107     - <<: *conan-linux
108       env: CONAN_CLANG_VERSIONS=5.0 CONAN_DOCKER_IMAGE=lasote/conanclang50
109     - <<: *conan-linux
110       env: CONAN_CLANG_VERSIONS=6.0 CONAN_DOCKER_IMAGE=lasote/conanclang60
111     - <<: *conan-osx
112       osx_image: xcode7.3
113       env: CONAN_APPLE_CLANG_VERSIONS=7.3
114     - <<: *conan-osx
115       osx_image: xcode8.3
116       env: CONAN_APPLE_CLANG_VERSIONS=8.1
117     - <<: *conan-osx
118       osx_image: xcode9
119       env: CONAN_APPLE_CLANG_VERSIONS=9.0
120     - <<: *conan-osx
121       osx_image: xcode9.3
122       env: CONAN_APPLE_CLANG_VERSIONS=9.1
123
124     #- language: android
125     #  sudo: true
126     #  android:
127     #    components:
128     #      - tools
129     #      - platform-tools
130     #      - build-tools-25.0.2
131     #      - android-25
132     #      - extra-android-m2repository
133     #  compiler:
134     #    - gcc
135     #  before_install:
136     #    - git clone https://github.com/urho3d/android-ndk.git $HOME/android-ndk-root
137     #    - export ANDROID_NDK_HOME=$HOME/android-ndk-root
138     #    # Setup environment for Linux build which is required to build the sample.
139     #    - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
140     #    - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi
141     #    - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq g++-$GCC_VERSION; fi
142     #    - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq gcc-$GCC_VERSION; fi
143     #    - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which g++-$GCC_VERSION) /usr/bin/g++; fi
144     #    - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which gcc-$GCC_VERSION) /usr/bin/gcc; fi
145     #  script:
146     #    - failed=0; for build_gradle in $(git ls-files | grep build.gradle); do ( cd "$(dirname "${build_gradle}")" && ./gradlew build ) || failed=1; done; exit $((failed))