From 8dfb3cc3ea033a80853373d61144aa2f3f5d29eb Mon Sep 17 00:00:00 2001 From: Renato Cavalcanti Date: Mon, 16 Dec 2019 23:27:10 +0100 Subject: [PATCH 1/4] fixing travis scripts --- scripts/test-code.sh | 7 +++++-- scripts/validate-code.sh | 6 ++++-- scripts/validate-docs.sh | 7 +++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/test-code.sh b/scripts/test-code.sh index f24fdb53..0b146f0c 100755 --- a/scripts/test-code.sh +++ b/scripts/test-code.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash -sbt "++ $TRAVIS_SCALA_VERSION test" || travis_terminate 1 -sbt +publishLocal plugin/test plugin/scripted || travis_terminate 1 \ No newline at end of file +set -e +set -o pipefail + +sbt "++ $TRAVIS_SCALA_VERSION test" +sbt +publishLocal plugin/test plugin/scripted \ No newline at end of file diff --git a/scripts/validate-code.sh b/scripts/validate-code.sh index 49e47eec..97d00195 100755 --- a/scripts/validate-code.sh +++ b/scripts/validate-code.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash -sbt ++$TRAVIS_SCALA_VERSION validateCode || travis_terminate 1 -sbt "++$TRAVIS_SCALA_VERSION mimaReportBinaryIssues" || travis_terminate 1 +set -e +set -o pipefail + +sbt ";++$TRAVIS_SCALA_VERSION ;validateCode ;mimaReportBinaryIssues" diff --git a/scripts/validate-docs.sh b/scripts/validate-docs.sh index d1caffc2..8b9627df 100755 --- a/scripts/validate-docs.sh +++ b/scripts/validate-docs.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash -pushd docs || travis_terminate 1 - sbt evaluateSbtFiles validateDocs headerCheck test:headerCheck test || travis_terminate 1 +set -e +set -o pipefail + +pushd docs + sbt evaluateSbtFiles validateDocs headerCheck test:headerCheck test popd From bbcd6a46073a8f7e34f8cec85df88f22a9af2b6f Mon Sep 17 00:00:00 2001 From: Renato Cavalcanti Date: Mon, 16 Dec 2019 23:55:48 +0100 Subject: [PATCH 2/4] using stages --- .travis.yml | 65 ++++++++++++++++++++++++++++++++-------- scripts/test-code.sh | 6 ++-- scripts/validate-code.sh | 4 ++- scripts/validate-docs.sh | 2 ++ 4 files changed, 62 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 96bbde60..9c60245d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,67 @@ language: scala -scala: - - 2.10.7 - - 2.12.10 - - 2.13.1 env: - - TRAVIS_JDK=8 - TRAVIS_JDK=11 before_install: curl -Ls https://git.io/jabba | bash && . ~/.jabba/jabba.sh install: jabba install "adopt@~1.$TRAVIS_JDK.0-0" && jabba use "$_" && java -Xmx32m -version -script: - - ./scripts/test-code.sh - - ./scripts/validate-code.sh - - ./scripts/validate-docs.sh +jobs: + include: + - stage: validations + script: scripts/validate-code.sh + name: "Code validations (headerCheck, scalafmt, mima)" + + - stage: test-jdk11 + name: "Run tests with Scala 2.10 and AdoptOpenJDK 11" + script: scripts/test-code.sh + env: + - TRAVIS_SCALA_VERSION=2.10.7 + - TRAVIS_JDK=11 + + - name: "Run tests with Scala 2.12 and AdoptOpenJDK 11" + script: scripts/test-code.sh + env: + - TRAVIS_SCALA_VERSION=2.12.11 + - TRAVIS_JDK=11 + + - name: "Run tests with Scala 2.13 and AdoptOpenJDK 11" + script: scripts/test-code.sh + env: + - TRAVIS_SCALA_VERSION=2.13.1 + - TRAVIS_JDK=11 + + - stage: test-jdk8 + name: "Run tests with Scala 2.10 and AdoptOpenJDK 8" + script: scripts/test-code.sh + env: + - TRAVIS_SCALA_VERSION=2.10.7 + - TRAVIS_JDK=8 + + - name: "Run tests with Scala 2.12 and AdoptOpenJDK 8" + script: scripts/test-code.sh + env: + - TRAVIS_SCALA_VERSION=2.12.11 + - TRAVIS_JDK=8 + + - name: "Run tests with Scala 2.13 and AdoptOpenJDK 8" + script: scripts/test-code.sh + env: + - TRAVIS_SCALA_VERSION=2.13.1 + - TRAVIS_JDK=8 + + + - stage: docs + script: scripts/validate-docs.sh + name: "Validate documentation" cache: directories: - - "$HOME/.ivy2/cache" - - "$HOME/.jabba/jdk" - - "$HOME/.sbt" + - "$HOME/.coursier/cache" + - "$HOME/.ivy2/cache" + - "$HOME/.ivy2/local" + - "$HOME/.jabba/jdk" + - "$HOME/.sbt" before_cache: - rm -rf $HOME/.ivy2/cache/com.typesafe.play/twirl* diff --git a/scripts/test-code.sh b/scripts/test-code.sh index 0b146f0c..bd63bdd2 100755 --- a/scripts/test-code.sh +++ b/scripts/test-code.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash +# Copyright (C) 2009-2019 Lightbend Inc. + set -e set -o pipefail -sbt "++ $TRAVIS_SCALA_VERSION test" -sbt +publishLocal plugin/test plugin/scripted \ No newline at end of file +sbt "++ $TRAVIS_SCALA_VERSION test" +sbt +publishLocal plugin/test plugin/scripted \ No newline at end of file diff --git a/scripts/validate-code.sh b/scripts/validate-code.sh index 97d00195..fca253d8 100755 --- a/scripts/validate-code.sh +++ b/scripts/validate-code.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash +# Copyright (C) 2009-2019 Lightbend Inc. + set -e set -o pipefail -sbt ";++$TRAVIS_SCALA_VERSION ;validateCode ;mimaReportBinaryIssues" +sbt ";+validateCode;+mimaReportBinaryIssues" diff --git a/scripts/validate-docs.sh b/scripts/validate-docs.sh index 8b9627df..155fa95b 100755 --- a/scripts/validate-docs.sh +++ b/scripts/validate-docs.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# Copyright (C) 2009-2019 Lightbend Inc. + set -e set -o pipefail From e40bf4ad9de7b56adfd6b7401c53ad9d73653e48 Mon Sep 17 00:00:00 2001 From: Renato Cavalcanti Date: Tue, 17 Dec 2019 12:01:55 +0100 Subject: [PATCH 3/4] user 'exit 1' instead of 'set -e' --- scripts/test-code.sh | 7 ++----- scripts/validate-code.sh | 5 +---- scripts/validate-docs.sh | 7 ++----- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/scripts/test-code.sh b/scripts/test-code.sh index bd63bdd2..97337724 100755 --- a/scripts/test-code.sh +++ b/scripts/test-code.sh @@ -2,8 +2,5 @@ # Copyright (C) 2009-2019 Lightbend Inc. -set -e -set -o pipefail - -sbt "++ $TRAVIS_SCALA_VERSION test" -sbt +publishLocal plugin/test plugin/scripted \ No newline at end of file +sbt "++ $TRAVIS_SCALA_VERSION test" || exit 1 +sbt +publishLocal plugin/test plugin/scripted || exit 1 \ No newline at end of file diff --git a/scripts/validate-code.sh b/scripts/validate-code.sh index fca253d8..e57b6abc 100755 --- a/scripts/validate-code.sh +++ b/scripts/validate-code.sh @@ -2,7 +2,4 @@ # Copyright (C) 2009-2019 Lightbend Inc. -set -e -set -o pipefail - -sbt ";+validateCode;+mimaReportBinaryIssues" +sbt ";+validateCode;+mimaReportBinaryIssues" || exit 1 diff --git a/scripts/validate-docs.sh b/scripts/validate-docs.sh index 155fa95b..6daa27b7 100755 --- a/scripts/validate-docs.sh +++ b/scripts/validate-docs.sh @@ -2,9 +2,6 @@ # Copyright (C) 2009-2019 Lightbend Inc. -set -e -set -o pipefail - -pushd docs - sbt evaluateSbtFiles validateDocs headerCheck test:headerCheck test +pushd docs || exit 1 + sbt evaluateSbtFiles validateDocs headerCheck test:headerCheck test || exit 1 popd From fbc2a9ab55e7e04e641641dd0435c8c5122bd382 Mon Sep 17 00:00:00 2001 From: Renato Cavalcanti Date: Fri, 20 Dec 2019 10:09:56 +0100 Subject: [PATCH 4/4] remove unnecessary .ivy2/local --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9c60245d..e03616e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,7 +59,6 @@ cache: directories: - "$HOME/.coursier/cache" - "$HOME/.ivy2/cache" - - "$HOME/.ivy2/local" - "$HOME/.jabba/jdk" - "$HOME/.sbt"