blob: 1dba26e040e53f2c101f56b335283f429e5a43f1 [file] [log] [blame]
Louis Ryanc42c8c42015-03-18 16:31:38 -07001sudo: false
2
Louis Ryan540b4d32015-09-04 13:26:24 -07003language: java
Louis Ryanc42c8c42015-03-18 16:31:38 -07004
5env:
6 global:
Eric Anderson56dca032016-02-12 08:48:41 -08007 - GRADLE_OPTS=-Xmx512m
Eric Andersondbef1af2016-05-23 12:05:41 -07008 - PROTOBUF_VERSION=3.0.0-beta-3
Eric Anderson80f73a42016-04-27 15:23:35 -07009 - LDFLAGS=-L/tmp/protobuf/lib
10 - CXXFLAGS=-I/tmp/protobuf/include
11 - LD_LIBRARY_PATH=/tmp/protobuf/lib
Louis Ryanc42c8c42015-03-18 16:31:38 -070012
Eric Andersona0acb9b2015-03-20 10:26:00 -070013before_install:
Eric Anderson1d7a11c2016-04-29 15:07:22 -070014 - mkdir -p $HOME/.gradle/caches &&
15 ln -s /tmp/gradle-caches-modules-2 $HOME/.gradle/caches/modules-2
16 - mkdir -p $HOME/.gradle &&
17 ln -s /tmp/gradle-wrapper $HOME/.gradle/wrapper
Eric Anderson6dc5e802015-10-15 14:52:24 -070018 # Work around https://github.com/travis-ci/travis-ci/issues/2317
19 - if \[ "$TRAVIS_OS_NAME" = linux \]; then jdk_switcher use oraclejdk8; fi
Kun Zhangbd23a8d2015-08-28 18:47:06 -070020 - buildscripts/make_dependencies.sh # build protoc into /tmp/protobuf-${PROTOBUF_VERSION}
Eric Anderson80f73a42016-04-27 15:23:35 -070021 - ln -s "/tmp/protobuf-${PROTOBUF_VERSION}/$(uname -s)-$(uname -p)" /tmp/protobuf
Eric Anderson26141b42015-03-21 10:59:17 -070022 - mkdir -p $HOME/.gradle
23 - echo "checkstyle.ignoreFailures=false" >> $HOME/.gradle/gradle.properties
Eric Anderson3c03eb72016-07-10 11:40:12 -070024 - echo "failOnWarnings=true" >> $HOME/.gradle/gradle.properties
Louis Ryanc42c8c42015-03-18 16:31:38 -070025
Eric Andersoncea8e8e2015-10-27 19:53:18 -070026install:
27 - ./gradlew assemble generateTestProto
28
Eric Anderson34571992015-05-07 17:00:44 -070029before_script:
30 - test -z "$(git status --porcelain)" || (git status && echo Error Working directory is not clean. Forget to commit generated files? && false)
31
Eric Anderson6715f122016-02-13 14:43:38 -080032script:
33 - ./gradlew check :grpc-all:jacocoTestReport
34
Eric Anderson522580d2015-08-07 18:02:31 -070035after_success:
Eric Anderson6dc5e802015-10-15 14:52:24 -070036 - if \[ "$TRAVIS_OS_NAME" = linux \]; then ./gradlew :grpc-all:coveralls; fi
Eric Anderson6715f122016-02-13 14:43:38 -080037 - bash <(curl -s https://codecov.io/bash)
Louis Ryanc42c8c42015-03-18 16:31:38 -070038
39os:
40 - linux
Eric Anderson6dc5e802015-10-15 14:52:24 -070041 - osx
42
43# This image comes with jdk8
44osx_image: xcode7
Louis Ryanc42c8c42015-03-18 16:31:38 -070045
Louis Ryanc42c8c42015-03-18 16:31:38 -070046notifications:
Eric Andersona0acb9b2015-03-20 10:26:00 -070047 email: false
48
Eric Anderson6dc5e802015-10-15 14:52:24 -070049# Caching does not work for public repositories with OS X:
50# https://github.com/travis-ci/travis-ci/issues/4011
Eric Andersona0acb9b2015-03-20 10:26:00 -070051cache:
52 directories:
Kun Zhangbd23a8d2015-08-28 18:47:06 -070053 - /tmp/protobuf-${PROTOBUF_VERSION}
Eric Anderson1d7a11c2016-04-29 15:07:22 -070054 - /tmp/gradle-caches-modules-2
55 - /tmp/gradle-wrapper
Eric Anderson16055782015-03-20 12:03:48 -070056
57before_cache:
Eric Anderson1d7a11c2016-04-29 15:07:22 -070058 # The lock changes based on folder name; normally $HOME/.gradle/caches/modules-2/modules-2.lock
59 - rm /tmp/gradle-caches-modules-2/gradle-caches-modules-2.lock
Eric Anderson3b54ffa2015-04-29 07:56:04 -070060 - find $HOME/.gradle/wrapper -not -name "*-all.zip" -and -not -name "*-bin.zip" -delete