Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sbt/setup-sbt
setup-sbt installs the official sbt runner
https://github.com/sbt/setup-sbt
github-actions sbt scala
Last synced: 3 days ago
JSON representation
setup-sbt installs the official sbt runner
- Host: GitHub
- URL: https://github.com/sbt/setup-sbt
- Owner: sbt
- License: mit
- Created: 2024-06-22T16:46:59.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-12-26T07:02:25.000Z (12 days ago)
- Last Synced: 2024-12-31T05:57:06.090Z (8 days ago)
- Topics: github-actions, sbt, scala
- Homepage: https://eed3si9n.com/setup-sbt/
- Size: 47.9 KB
- Stars: 18
- Watchers: 5
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Setup sbt
=========This action enables `sbt` runner from GitHub Actions.
Usage
-----Here's an example usage of setup-sbt action.
```yaml
env:
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: sbt
- uses: sbt/setup-sbt@v1
- name: Build and test
shell: bash
run: sbt -v +test
````uses: sbt/setup-sbt@v1` makes `sbt` available on Linux, macOS, and Windows.
### Setting the runner version
The `sbt` runner (Bash script that launches sbt) is typically compatible with all modern sbt releases,
you might want to pin the runner to a specific version.```yaml
env:
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: sbt
- uses: sbt/setup-sbt@v1
with:
sbt-runner-version: 1.9.9
- name: Build and test
shell: bash
run: sbt -v +test
```Why is this GitHub Action needed?
---------------------------------The runner images on GitHub Action had long included `sbt` runner script. The [initial commit on actions/runner-images](https://github.com/actions/runner-images/pull/96) contains `images/linux/scripts/installers/sbt.sh`
### May 2024
However, the situation has changed in May 2024 when GitHub released the runner image for `macos-13` and `macos-14`, users noticed that they were missing the `sbt` runner script.
[actions/runner-images#9369](https://github.com/actions/runner-images/issues/9369) and [actions/runner-images#9837](https://github.com/actions/runner-images/issues/9837) confirmed that this was intentional:
> Thank you for such detail request. But currently we have no plans to add `sbt` on `macOS-13`/`macOS-14`.
Since GitHub Actions are extensible, we thought this providing a setup action would be convenient way to enable `sbt` again on all runner images.
### December 2024
The situation changed again in December 2024 when GitHub dropped sbt from `ubuntu-latest`. So now this same action is needed for Ubuntu-based builds, too.
License
-------The scripts and documentation in this project are released under the [MIT License](LICENSE).