From 18e7985906a6f35fdc7642940606ec6abc53a8cc Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Sat, 7 May 2016 18:53:17 -0700 Subject: [PATCH 1/6] [SPARK-15207][BUILD] Use Travis CI for Java/Scala/Python Linter and JDK7/8 compilation test --- .travis.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000000..194c9fd37017 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,48 @@ +# 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. + +sudo: required + +dist: trusty + +language: java + +jdk: + - oraclejdk7 + - oraclejdk8 + +addons: + apt: + packages: + - python-numpy + - python-sphinx + +cache: + directories: + - $HOME/.sbt + - $HOME/.m2 + +notifications: + email: false + +install: true + +script: + - export MAVEN_SKIP_RC=1 + - dev/check-license && + dev/lint-python && + dev/lint-scala && + dev/lint-java && + (build/mvn -DskipTests -Pyarn -Phadoop-2.3 -Pkinesis-asl -Phive -Phive-thriftserver compile | grep -v 'org/maven2/') From 8a07bf8ab550e563f89e3dd908fe7bb68ecae2c5 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Sun, 8 May 2016 13:21:15 -0700 Subject: [PATCH 2/6] Add test-compile, too. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 194c9fd37017..55892a4dc499 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,4 +45,4 @@ script: dev/lint-python && dev/lint-scala && dev/lint-java && - (build/mvn -DskipTests -Pyarn -Phadoop-2.3 -Pkinesis-asl -Phive -Phive-thriftserver compile | grep -v 'org/maven2/') + (build/mvn -DskipTests -Pyarn -Phadoop-2.3 -Pkinesis-asl -Phive -Phive-thriftserver compile test-compile | grep -v 'org/maven2/') From a0e49b8a90c7c435991104b9eb007e7984eaa1d8 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Mon, 9 May 2016 17:37:23 -0700 Subject: [PATCH 3/6] Run lint-java after `maven install`. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 55892a4dc499..6933a43ae749 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,5 +44,5 @@ script: - dev/check-license && dev/lint-python && dev/lint-scala && - dev/lint-java && - (build/mvn -DskipTests -Pyarn -Phadoop-2.3 -Pkinesis-asl -Phive -Phive-thriftserver compile test-compile | grep -v 'org/maven2/') + (build/mvn -T 2 -DskipTests -Ddoc-jar.skip=true -Pyarn -Phadoop-2.3 -Pkinesis-asl -Phive -Phive-thriftserver install | grep -v 'org/maven2/' | grep -v 'from the shaded jar') && + dev/lint-java From 2583abc7926fd73a69e26861f618a9a0e4ae3de5 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Mon, 9 May 2016 21:21:55 -0700 Subject: [PATCH 4/6] Remove RAT and Python linter. --- .travis.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6933a43ae749..762281d40760 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,12 +37,9 @@ cache: notifications: email: false -install: true +install: + - export MAVEN_SKIP_RC=1 + - build/mvn -T 4 -q -DskipTests -Pyarn -Phadoop-2.3 -Pkinesis-asl -Phive -Phive-thriftserver install script: - - export MAVEN_SKIP_RC=1 - - dev/check-license && - dev/lint-python && - dev/lint-scala && - (build/mvn -T 2 -DskipTests -Ddoc-jar.skip=true -Pyarn -Phadoop-2.3 -Pkinesis-asl -Phive -Phive-thriftserver install | grep -v 'org/maven2/' | grep -v 'from the shaded jar') && - dev/lint-java + - dev/lint-java From c4f5f8da277576c86bf6f4acd649efba0d37eb54 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Mon, 9 May 2016 22:27:09 -0700 Subject: [PATCH 5/6] Add comments and remove addons related to lint-python. --- .travis.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 762281d40760..66bde828bb7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,33 +13,36 @@ # See the License for the specific language governing permissions and # limitations under the License. -sudo: required +# Travis CI Guide +# - Environment Setup: https://docs.travis-ci.com/user/trusty-ci-environment +# - Buidling Java Project: https://docs.travis-ci.com/user/languages/java +# - Caching: https://docs.travis-ci.com/user/caching +# 1. Choose OS (Ubuntu 14.04.3 LTS Server Edition 64bit, ~2 CORE, 7.5GB RAM) +sudo: required dist: trusty +# 2. Choose language and target JDKs for parallel builds. language: java - jdk: - oraclejdk7 - oraclejdk8 -addons: - apt: - packages: - - python-numpy - - python-sphinx - +# 3. Setup cache directory for SBT and Maven. cache: directories: - $HOME/.sbt - $HOME/.m2 +# 4. Turn off notifications. notifications: email: false +# 5. Run maven install before running lint-java. install: - export MAVEN_SKIP_RC=1 - build/mvn -T 4 -q -DskipTests -Pyarn -Phadoop-2.3 -Pkinesis-asl -Phive -Phive-thriftserver install +# 6. Run lint-java. script: - dev/lint-java From 893e8bcbfe73e1abcf4e33c8bb050f0282005965 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Tue, 10 May 2016 10:15:49 -0700 Subject: [PATCH 6/6] Changes comments. --- .travis.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 66bde828bb7b..c16f76399ccd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Travis CI Guide -# - Environment Setup: https://docs.travis-ci.com/user/trusty-ci-environment -# - Buidling Java Project: https://docs.travis-ci.com/user/languages/java -# - Caching: https://docs.travis-ci.com/user/caching +# Spark provides this Travis CI configuration file to help contributors +# check Scala/Java style conformance and JDK7/8 compilation easily +# during their preparing pull requests. +# - Scalastyle is executed during `maven install` implicitly. +# - Java Checkstyle is executed by `lint-java`. +# See the related discussion here. +# https://github.com/apache/spark/pull/12980 # 1. Choose OS (Ubuntu 14.04.3 LTS Server Edition 64bit, ~2 CORE, 7.5GB RAM) sudo: required