Limit formatter to pull requests only (#6540)
[platform/upstream/flatbuffers.git] / .travis.yml
index 17d3cc0..3ca86de 100644 (file)
@@ -104,6 +104,7 @@ matrix:
       - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s -v -f $(which gcc-$GCC_VERSION) /usr/bin/gcc; fi
 
       script:
+      - pip install cmake
       - bash .travis/check-sources.sh
       - bash grpc/build_grpc.sh
       - cmake .
@@ -114,7 +115,7 @@ matrix:
         -DFLATBUFFERS_CODE_SANITIZE=ON
       - cmake --build . --target all --clean-first -- -j${JOBS}
       - LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/google/grpc/install/lib ctest --extra-verbose --output-on-failure
-      - bash .travis/check-generate-code.sh
+      - bash scripts/check-generate-code.sh
 
     - language: cpp
       os: osx
@@ -125,6 +126,11 @@ matrix:
           - BUILD_TYPE=Release
 
       script:
+      - pip install --user cmake
+      - mkdir ~/cmake_path
+      - ln -s $(find ~/Library/Python -name cmake -type f | head -n 1) ~/cmake_path/cmake
+      - ln -s $(find ~/Library/Python -name ctest -type f | head -n 1) ~/cmake_path/ctest
+      - export PATH=~/cmake_path:${PATH}
       - bash grpc/build_grpc.sh
       - cmake .
         -DCMAKE_BUILD_TYPE=$BUILD_TYPE
@@ -134,7 +140,7 @@ matrix:
         -DFLATBUFFERS_CODE_SANITIZE=ON
       - cmake --build . -- -j${JOBS}
       - DYLD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/google/grpc/install/lib ctest --extra-verbose --output-on-failure
-      - bash .travis/check-generate-code.sh
+      - bash scripts/check-generate-code.sh
 
     - <<: *conan-linux-master
       env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/gcc8
@@ -200,3 +206,12 @@ matrix:
       script:
         - cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF .; make; export PATH="$PATH:${PWD}"
         - cd android; ./gradlew clean build
+
+    - language: generic
+      if: type IN (pull_request)
+      os: linux
+      install:
+        - bash .travis/format_install.sh
+
+      script:
+        - bash .travis/format_check.sh