Add 'fsanitize=address,undefined' to tests and flatc targets (#5009)
[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 . 
77         -DCMAKE_BUILD_TYPE=$BUILD_TYPE 
78         -DFLATBUFFERS_BUILD_GRPCTEST=ON 
79         -DGRPC_INSTALL_PATH=$TRAVIS_BUILD_DIR/google/grpc/install 
80         -DPROTOBUF_DOWNLOAD_PATH=$TRAVIS_BUILD_DIR/google/grpc/third_party/protobuf
81         -DFLATBUFFERS_CODE_SANITIZE=ON
82       - make
83       - LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/google/grpc/install/lib make test ARGS=-V
84       - bash .travis/check-generate-code.sh
85       - 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
86
87     - language: cpp
88       os: osx
89       osx_image: xcode9.3
90       env:
91         matrix:
92           - BUILD_TYPE=Debug
93           - BUILD_TYPE=Release
94       script:
95       - bash grpc/build_grpc.sh
96       - cmake .
97         -DCMAKE_BUILD_TYPE=$BUILD_TYPE 
98         -DFLATBUFFERS_BUILD_GRPCTEST=ON 
99         -DGRPC_INSTALL_PATH=$TRAVIS_BUILD_DIR/google/grpc/install 
100         -DPROTOBUF_DOWNLOAD_PATH=$TRAVIS_BUILD_DIR/google/grpc/third_party/protobuf
101         -DFLATBUFFERS_CODE_SANITIZE=ON
102       - make
103       - ./flattests
104       - bash .travis/check-generate-code.sh
105       - DYLD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/google/grpc/install/lib ./grpctest
106
107     - <<: *conan-linux
108       env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=lasote/conangcc49
109     - <<: *conan-linux
110       env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=lasote/conangcc5
111     - <<: *conan-linux
112       env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=lasote/conangcc6
113     - <<: *conan-linux
114       env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=lasote/conangcc7
115     - <<: *conan-linux
116       env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=lasote/conangcc8
117     - <<: *conan-linux
118       env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=lasote/conanclang39
119     - <<: *conan-linux
120       env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=lasote/conanclang40
121     - <<: *conan-linux
122       env: CONAN_CLANG_VERSIONS=5.0 CONAN_DOCKER_IMAGE=lasote/conanclang50
123     - <<: *conan-linux
124       env: CONAN_CLANG_VERSIONS=6.0 CONAN_DOCKER_IMAGE=lasote/conanclang60
125     - <<: *conan-osx
126       osx_image: xcode7.3
127       env: CONAN_APPLE_CLANG_VERSIONS=7.3
128     - <<: *conan-osx
129       osx_image: xcode8.3
130       env: CONAN_APPLE_CLANG_VERSIONS=8.1
131     - <<: *conan-osx
132       osx_image: xcode9
133       env: CONAN_APPLE_CLANG_VERSIONS=9.0
134     - <<: *conan-osx
135       osx_image: xcode9.3
136       env: CONAN_APPLE_CLANG_VERSIONS=9.1
137
138     - language: android
139       sudo: true
140       android:
141         components:
142           - tools
143           - platform-tools
144           - build-tools-25.0.2
145           - android-25
146           - extra-android-m2repository
147       compiler:
148         - gcc
149       before_install:
150         - git clone https://github.com/urho3d/android-ndk.git $HOME/android-ndk-root
151         - export ANDROID_NDK_HOME=$HOME/android-ndk-root
152         # Setup environment for Linux build which is required to build the sample.
153         - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
154         - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi
155         - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq g++-$GCC_VERSION; fi
156         - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq gcc-$GCC_VERSION; fi
157         - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which g++-$GCC_VERSION) /usr/bin/g++; fi
158         - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which gcc-$GCC_VERSION) /usr/bin/gcc; fi
159       script:
160         - failed=0; for build_gradle in $(git ls-files | grep build.gradle); do ( cd "$(dirname "${build_gradle}")" && ./gradlew build ) || failed=1; done; exit $((failed))