vdiravka commented on a change in pull request #1636: DRILL-7031: Add Travis job that runs protobuf generation command and checks if all protobufs are up-to-date URL: https://github.com/apache/drill/pull/1636#discussion_r254632478
########## File path: .travis.yml ########## @@ -13,13 +13,43 @@ # See the License for the specific language governing permissions and # limitations under the License. -before_install: git fetch --unshallow +matrix: + fast_finish: true + include: + - env: PHASE=tests + - env: PHASE=protobuf sudo: required language: java jdk: - openjdk8 cache: directories: - "$HOME/.m2" -install: MAVEN_OPTS="-Xms1G -Xmx1G" mvn install --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -DskipTests=true -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -script: mvn install -Drat.skip=false -Dlicense.skip=false -DexcludedGroups="org.apache.drill.categories.SlowTest,org.apache.drill.categories.UnlikelyTest,org.apache.drill.categories.SecurityTest" -DforkCount=1 -DmemoryMb=2560 -DdirectMemoryMb=4608 -Ptravis +before_install: + - git fetch --unshallow + # Install libraries required for protobuf generation + - | + if [ $PHASE = "protobuf" ]; then \ + sudo apt-get install -y libboost-all-dev libzookeeper-mt-dev libsasl2-dev cmake libcppunit-dev && \ + pushd .. && wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz && \ + tar -xzvf protobuf-2.5.0.tar.gz && \ + pushd protobuf-2.5.0 && ./configure --prefix=/usr && make && sudo make install && popd && popd; \ + fi +install: + # For tests phase runs unit tests + # For protobuf phase, builds and checks Drill for license and checkstyle, regenerates java and c++ protobufs + - | + if [ $PHASE = "tests" ]; then \ + mvn install --batch-mode -DexcludedGroups="org.apache.drill.categories.SlowTest,org.apache.drill.categories.UnlikelyTest,org.apache.drill.categories.SecurityTest" -DforkCount=1 -DmemoryMb=2560 -DdirectMemoryMb=4608 -Ptravis; \ + elif [ $PHASE = "protobuf" ]; then \ + MAVEN_OPTS="-Xms1G -Xmx1G" mvn install --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -DskipTests=true -Dmaven.javadoc.skip=true -Dmaven.source.skip=true && \ + pushd protocol && mvn process-sources -P proto-compile && popd && \ + mkdir contrib/native/client/build && pushd contrib/native/client/build && cmake -G "Unix Makefiles" .. && make cpProtobufs && popd; \ + fi +script: + # Checks whether project files weren't changed after regenerating protobufs + - | + if [ "$(git status -s | grep -c "")" -gt 0 ]; then \ + echo "Found changes in the following files after regenerating protobufs:" $(git status -s) >&2 && \ Review comment: Does it make sense to add `git diff` additionally? It can provide more info for understanding what operators(or other objects) require Protobuf update. But will not take effect for the clean build, which doesn't require regenerating Protobuf files. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
