Skip to content

Integrate sbt into setup-java or create a new one called setup-sbt for better support for self-hosted runners 🚀  #266

Closed

Description

@dimisjim

Description:
Seems that, currently, sbt is part of the github-provided virtual environments, and not in setup-java

Justification:
Having sbt installed in the github.com-provided runners is a bit problematic for users of self-hosted runners as it causes false expectations for this setup-java action, given that sbt is actually something that needs java to function. Thus installation of it would make much more sense to happen in this action, or alternatively in another new one, called setup-sbt or setup-scala (actually, an action with this name already exists and depends on a not very stable project, called jabba, see olafurpg/setup-scala#48 for more background on this)

I had previously opened: actions/starter-workflows#1309 which I have now closed, to keep comms here exclusively.

Our current, in-house workaround is to use sdkman.io to install everything manually in our self-hosted runners.

Are you willing to submit a PR?
Yes

Activity

  1. joschi commented on Dec 22, 2021

    @joschi
    Contributor

    Why wouldn't you use https://github.com/dwijnand/sbt-extras for this, similar to how it is typically done in Gradle projects (using the Gradle wrapper script)?

  2. dimisjim commented on Dec 22, 2021

    @dimisjim
    Author

    We have already used a script, like the one you linked.

    This issue refers to native github actions, but thanks for sharing anyway 👍

  3. dmitry-shibanov commented on Dec 23, 2021

    @dmitry-shibanov
    Contributor

    Hello @dimisjim. Thank you for your report. We do not plan to add functionality in the setup-java action to install sbt. The main purpose of the setup-java action is to install java from available distributions. Could you please check existing actions for sbt ?

  4. guizmaii commented on Jan 31, 2022

    @guizmaii
  5. fmeriaux commented on Mar 24, 2022

    @fmeriaux

    +1

    it would be interesting to integrate the sbt cache like mvn or gradle https://github.com/actions/cache/blob/main/examples.md#scala---sbt

  6. joschi commented on Mar 24, 2022

    @joschi
    Contributor

    @fmeriaux Go for it. 😉

    setup-java/src/cache.ts

    Lines 23 to 36 in f69f00b

    const supportedPackageManager: PackageManager[] = [
    {
    id: 'maven',
    path: [join(os.homedir(), '.m2', 'repository')],
    // https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven
    pattern: ['**/pom.xml']
    },
    {
    id: 'gradle',
    path: [join(os.homedir(), '.gradle', 'caches'), join(os.homedir(), '.gradle', 'wrapper')],
    // https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---gradle
    pattern: ['**/*.gradle*', '**/gradle-wrapper.properties']
    }
    ];

  7. fmeriaux commented on Mar 24, 2022

    @fmeriaux

    @fmeriaux Go for it. 😉

    setup-java/src/cache.ts

    Lines 23 to 36 in f69f00b

    const supportedPackageManager: PackageManager[] = [
    {
    id: 'maven',
    path: [join(os.homedir(), '.m2', 'repository')],
    // https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven
    pattern: ['**/pom.xml']
    },
    {
    id: 'gradle',
    path: [join(os.homedir(), '.gradle', 'caches'), join(os.homedir(), '.gradle', 'wrapper')],
    // https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---gradle
    pattern: ['**/*.gradle*', '**/gradle-wrapper.properties']
    }
    ];

    done #302

  8. laughedelic commented on Mar 24, 2022

    @laughedelic

    FYI: https://github.com/coursier/cache-action handles sbt cache (also Mill, Ammonite, and is highly configurable).

  9. dmitry-shibanov commented on Apr 26, 2022

    @dmitry-shibanov
    Contributor

    Hello everyone. The new version was released with sbt caching support.

  10. dmitry-shibanov commented on May 24, 2022

    @dmitry-shibanov
    Contributor

    Hello everyone. I'm going to close the issue because the new version with sbt caching support was released and the major tag was updated. If you have any concerns feel free to ping us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or request to improve the current logic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions