aboutsummaryrefslogtreecommitdiff
path: root/.travis.yml
blob: c7def481049388977d4c58f9ada364627410b81c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

matrix:
  fast_finish: true
  include:
    - env: PHASE=tests
    - env: PHASE=build_checkstyle_protobuf
sudo: required
language: java
jdk:
  - openjdk8
cache:
  directories:
  - "$HOME/.m2"
before_install:
  - git fetch --unshallow
  # Install libraries required for protobuf generation
  - |
    if [ $PHASE = "build_checkstyle_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 Drill project, performs license checkstyle goal and regenerates Java and C++ Protobuf files
  - |
    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 = "build_checkstyle_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 "The following changes are found in files after regenerating protobufs (output may be used as a patch to apply):" >&2 &&
      echo "$(git diff --color)" && \
      exit 1; \
    else
      echo "All checks are passed!";
    fi