Skip to content

Commit

Permalink
Travis-CI: use standardized JDK+sbt setup
Browse files Browse the repository at this point in the history
The issue here is that by default, Travis-CI has an outdated
sbt-extras script that doesn't work with sbt 1.4.8+.

A more minimal fix would be to add the workaround suggested
in the sbt 1.4.8 and 1.4.9 release notes.

But down that path lies further hand-maintenance.  I think it's better
to use the Travis-CI stuff in the scala-dev repo, which is maintained
by the Scala team at lightbend. It handles JDK installation (via
SDKMAN not Jabba), addresses the sbt 1.4.8+ issue (and will address
any other such issues that arise in the future), and handles
caching, too.
  • Loading branch information
SethTisue committed Mar 17, 2021
1 parent c35f448 commit 787150e
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
version: ~> 1.0
import: scala/scala-dev:travis/default.yml

language: scala

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

env:
matrix:
- TRAVIS_JDK=11
- ADOPTOPENJDK=11

global:
# encrypt with: travis encrypt --pro BINTRAY_USER=...
- secure: "TV8cmq1UrtAmwxpaZTI89qEu+kYFgDqRJ2pm2F8TG75TmPWMUZ8YycYld8wWn2dMOXMc5mpDUYYXiJpqnxxiF90lYdCzN/TIJlLGEsHthXSS9UTHyqrCAh5JyT0XiQZmjP+6oCmWJLpdDayrgyTRqQNkUSFboEqN25aXJuCkCDw="
# encrypt with: travis encrypt --pro BINTRAY_PASS=...
- secure: "XHaF/fAX2H78Bc/5+nyQkSYLQfRX17SP4xBjF15iTxr9v9F2P0KxqsZ4qng2xHaQeUN122iXssOaZviQo4W+Z/o9FqoLXuUq9ukMol48RCFQjJXXnNNmdLmivetOJXOogAu9hHcRTeOoZ197RovIKbgnHIiavicsA3HMPNtm/bw="


before_install: curl -Ls https://raw.githubusercontent.com/shyiko/jabba/0.11.2/install.sh | bash && . ~/.jabba/jabba.sh
install: jabba install "adopt@~1.$TRAVIS_JDK.0-0" && jabba use "$_" && java -Xmx32m -version

jobs:
include:
- stage: test
Expand All @@ -28,25 +26,25 @@ jobs:
script: scripts/test-code.sh
env:
- TRAVIS_SCALA_VERSION=2.12.13
- TRAVIS_JDK=11
- ADOPTOPENJDK=11

- name: "Run tests with Scala 2.13 and AdoptOpenJDK 11"
script: scripts/test-code.sh
env:
- TRAVIS_SCALA_VERSION=2.13.5
- TRAVIS_JDK=11
- ADOPTOPENJDK=11

- name: "Run tests with Scala 2.12 and AdoptOpenJDK 8"
script: scripts/test-code.sh
env:
- TRAVIS_SCALA_VERSION=2.12.13
- TRAVIS_JDK=8
- ADOPTOPENJDK=8

- name: "Run tests with Scala 2.13 and AdoptOpenJDK 8"
script: scripts/test-code.sh
env:
- TRAVIS_SCALA_VERSION=2.13.5
- TRAVIS_JDK=8
- ADOPTOPENJDK=8

- stage: docs
script: scripts/validate-docs.sh
Expand All @@ -63,19 +61,6 @@ stages:
# Snapshots from Bintray are picked up by a scheduled build on Lightbend's Vegemite
if: ((branch = master AND type = push) OR (tag IS present)) AND NOT fork

cache:
directories:
- "$HOME/.cache/coursier"
- "$HOME/.ivy2/cache"
- "$HOME/.jabba/jdk"
- "$HOME/.sbt"

before_cache:
- rm -rf $HOME/.ivy2/cache/com.typesafe.play/twirl*
- rm -rf $HOME/.ivy2/cache/scala_*/sbt_*/com.typesafe.sbt/sbt-twirl
- find $HOME/.ivy2 -name "ivydata-*.properties" -delete
- find $HOME/.sbt -name "*.lock" -delete

notifications:
webhooks:
urls: https://webhooks.gitter.im/e/d2c8a242a2615f659595
Expand Down

0 comments on commit 787150e

Please sign in to comment.