Skip to content

GitHub Action to install any version of Java (GraalVM, Java 8, Java 11, Java 14, ...) via Jabba. Works for any JVM language including Java, Scala and Kotlin.

License

Notifications You must be signed in to change notification settings

olafurpg/setup-scala

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Setup Scala GitHub Action

A GitHub Action to install Java via Jabba and sbt.

  • Configurable Java version: supports OpenJDK, GraalVM, Zulu and any other Java version that's installable via Jabba.
  • The sbt command is installed using the sbt-extras launcher.
  • For faster startup, the csbt command is installed using the Coursier-based sbt-extras launcher. This launcher does not work with all builds, only use csbt if you know what you are doing.

Usage:

In your GitHub Actions workflow, add a uses: declaration before calling the sbt command.

+++ .github/workflows/ci.yml
  name: CI
  on:
    push:
  jobs:
    build:
      runs-on: ubuntu-latest
      steps:
      - uses: actions/checkout@v1
+     - uses: olafurpg/setup-scala@v2
      - name: Compile
        run: sbt compile

The default Java version is the latest OpenJDK 8 HotSpot version via AdoptOpenJDK. To customize the Java version add a with: declaration. For example, to use the latest AdoptOpenJDK 11 version

+++ .github/workflows/ci.yml
  name: CI
  on:
    push:
  jobs:
    build:
      runs-on: ubuntu-latest
      steps:
      - uses: actions/checkout@v1
      - uses: olafurpg/setup-scala@v2
+       with:
+         java-version: adopt@1.11
      - name: Compile
        run: sbt compile

More Java version examples:

  • graalvm@: the latest GraalVM
  • openjdk@1.14: the latest OpenJDK 14 version
  • zulu@1.11: the latest Zulu OpenJDK 11

About

GitHub Action to install any version of Java (GraalVM, Java 8, Java 11, Java 14, ...) via Jabba. Works for any JVM language including Java, Scala and Kotlin.

Topics

Resources

License

Stars

Watchers

Forks