Skip to content

Sets up Java & sbt, with good defaults for the Guardian

Notifications You must be signed in to change notification settings

guardian/setup-scala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup Scala

Combining setup-java & setup-sbt with good defaults for the Guardian

How to use

Get rid of this:

      - name: Setup JDK
        uses: actions/setup-java@v4
        with:
          distribution: corretto
          java-version: 21
          cache: sbt

and replace it with this:

      - uses: guardian/setup-scala@v1

Specifically:

  • In your GitHub Action workflow definition (eg ci.yml), under steps::
    • Remove the setup-java step and its config (and setup-sbt if you have it)
    • Add - uses: guardian/setup-scala@v1 where the actions/setup-java config was (example)
  • Add a .tool-versions file if you don't already have one, specifying the version of Java you want to use (example)

Example PR removing setup-java and installing setup-scala.

Java version

  • Java distribution used: always the AWS Corretto distribution of Java, the standard Java distro used at the Guardian.

Note that (like gha-scala-library-release-workflow) guardian/setup-scala requires that projects specify their Java version with an asdf-formatted .tool-versions file.

Only Java major version is respected

Although asdf requires a fully-specified Java version (eg 21.0.3.9.1) in the .tool-versions file, currently the workflow will only match the major version of Java specified in the file (eg 21).

This is due to limitations in actions/setup-java.

About

Sets up Java & sbt, with good defaults for the Guardian

Resources

Code of conduct

Stars

Watchers

Forks

Packages

No packages published