Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dimisjim opened this issue Dec 18, 2021 · 10 comments
Labels
feature request New feature or request to improve the current logic

Comments

@dimisjim
Copy link

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

@joschi
Copy link
Contributor

joschi commented Dec 22, 2021

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)?

@dimisjim
Copy link
Author

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

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

@dmitry-shibanov
Copy link
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 ?

@guizmaii
Copy link

@dimisjim sbt has been added to the by-default-installed softwares of the latest OS versions supported in Github Actions (see https://github.com/actions/virtual-environments#available-environments for the OS versions):

@fmeriaux
Copy link
Contributor

+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

@joschi
Copy link
Contributor

joschi commented Mar 24, 2022

@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']
}
];

@fmeriaux
Copy link
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']
}
];

done #302

@laughedelic
Copy link

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

@dmitry-shibanov
Copy link
Contributor

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

@dmitry-shibanov
Copy link
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
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

No branches or pull requests

6 participants