A simple Github action, that makes Sdkman's managed SDKs available for your GitHub actions workflow.
Installed dependencies are cached via actions/cache, however, it is used for gihub-hosted runner only, because for a self-hosted runner it works pretty slow.
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: setup kscript
uses: sfesenko/setup-sdkman@v1
with:
deps: kscript
- name: run kscript
run: kscript 'println("Hello, world!")'Dependeny version also may be specified:
- name: Install GrallVM
uses: sfesenko/setup-sdkman@v1
with:
deps: java:21.3.0.r17-grlAll installed sdks will be added to $PATH automatically, but in order to make sdk command available, sdkman's init script must be referenced explicitly:
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- uses: sfesenko/setup-sdkman@v1
- run: |
source ~/.sdkman/bin/sdkman-init.sh
sdk version