Skip to content

Commit

Permalink
Merge pull request #293 from renatocaval/fix-travis-scripts-with-stages
Browse files Browse the repository at this point in the history
Fix Travis builds (using stages)
  • Loading branch information
mergify[bot] authored Jan 6, 2020
2 parents cfb7928 + 1f09154 commit 55871df
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 15 deletions.
57 changes: 48 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,62 @@
language: scala
scala:
- 2.10.7
- 2.12.10
- 2.13.1

git:
depth: false # Avoid sbt-dynver not seeing the tag

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:
Expand Down
6 changes: 4 additions & 2 deletions scripts/test-code.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash

sbt "++ $TRAVIS_SCALA_VERSION test" || travis_terminate 1
sbt +publishLocal plugin/test plugin/scripted || travis_terminate 1
# Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>

sbt "++ $TRAVIS_SCALA_VERSION test" || exit 1
sbt +publishLocal plugin/test plugin/scripted || exit 1
5 changes: 3 additions & 2 deletions scripts/validate-code.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash

sbt ++$TRAVIS_SCALA_VERSION validateCode || travis_terminate 1
sbt "++$TRAVIS_SCALA_VERSION mimaReportBinaryIssues" || travis_terminate 1
# Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>

sbt ";+validateCode;+mimaReportBinaryIssues" || exit 1
6 changes: 4 additions & 2 deletions scripts/validate-docs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

pushd docs || travis_terminate 1
sbt evaluateSbtFiles validateDocs headerCheck test:headerCheck test || travis_terminate 1
# Copyright (C) 2009-2019 Lightbend Inc. <https://www.lightbend.com>

pushd docs || exit 1
sbt evaluateSbtFiles validateDocs headerCheck test:headerCheck test || exit 1
popd

0 comments on commit 55871df

Please sign in to comment.