Skip to content
Oeiuwq Faith Blog OpenSource Porfolio

coursier/setup-action

▶️ GitHub Action using Coursier to install JVM and Scala tools

coursier/setup-action.json
{
"createdAt": "2020-10-26T00:45:10Z",
"defaultBranch": "main",
"description": "▶️ GitHub Action using Coursier to install JVM and Scala tools",
"fullName": "coursier/setup-action",
"homepage": "",
"language": "TypeScript",
"name": "setup-action",
"pushedAt": "2026-08-04T16:02:27Z",
"stargazersCount": 61,
"topics": [
"coursier",
"coursier-setup",
"github-actions",
"jvm",
"scala",
"setup-scala"
],
"updatedAt": "2026-08-04T16:03:46Z",
"url": "https://github.com/coursier/setup-action"
}

A GitHub Action to install Coursier and use it to install Java and Scala CLI tools.

It can be useful if you want to install a specific version of JVM or use a build tool like mill or seed.

Inspired by olafurpg/setup-scala and the blog post Single command Scala setup by Alex Archambault (author of Coursier).

  • run it on any platform: Linux, MacOS, Windows
  • install any JVM you need
  • setup the build tool of your choice: sbt, mill, seed, etc.
  • install other common Scala CLI tools: Ammonite, Bloop, giter8, etc.
  • jvm (optional): JVM to install

    • one of the options from cs java --available.
    • if left empty either the existing JVM will be used or Coursier will install its default JVM.
  • jvm-index (optional): The JVM index source

    • arbitrary URL containing the JVM index source like in cs java --available --jvm-index https://url/of/your/index.json.
    • if left empty the coursier index will be used as default JVM index source
  • apps (optional): Scala apps to install (sbtn by default)

  • version (optional): Coursier version to install

    • a release version such as 2.1.25-M26 (defaults to a recent release when left empty)
    • nightly installs the latest nightly build
  • customRepositories (optional): ”

  • disableDefaultRepos (optional): ‘false’

    • Whether or not to pass the —no-default flag to coursier
  • mirrors (optional): ”

    • Newline-separated list of from=to entries written to ~/.config/coursier/mirror.properties before any cs invocation.
    • The from side may be a comma-separated list of source URLs.
    • Unlike customRepositories / disableDefaultRepos, mirrors are applied at the resolver level to every repository coursier sees — including ones declared inside app descriptors that customRepositories cannot override.
    • See coursier mirrors.
  • extraJvmArgs (optional): ”

    • Space-separated list of -D JVM property args passed to every cs invocation. The -J prefix is added automatically if missing.
    • e.g. -Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=8080
  • launcher (optional): Coursier launcher

    • Leave empty (default) to install the default native binary launcher when available, or a JVM launcher on platforms that do not have a native launcher.
    • thin (or jvm) selects the thin JVM launcher and assembly selects the assembly (fat JAR) launcher. These require Java to be installed beforehand.
    • Other values select a native launcher flavor. Available flavors include container, compat, and static; for example, container downloads the launcher whose filename ends in -container.
    • The action fails when the selected launcher is not available for the selected version and platform.
  • preferredLauncher (optional): Preferred Coursier launcher flavor

    • Downloads the same launcher as launcher, but falls back to the default launcher with a warning when the flavored download returns a 4xx HTTP response.
    • The JVM launcher values thin, jvm, and assembly are rejected; pass those via launcher.
    • Cannot be used together with launcher.
  • useContainerImage (optional): Deprecated alias for launcher: container.

steps:
- uses: actions/checkout@v4
- uses: coursier/setup-action@v3
with:
jvm: adopt:11
jvm-index: https://url/of/your/index.json
apps: sbtn bloop ammonite
disableDefaultRepos: true
customRepositories: https://packages.corp.com/maven
mirrors: |
https://repo1.maven.org/maven2=https://packages.corp.com/maven
steps:
- uses: actions/checkout@v4
- uses: coursier/setup-action@v3
with:
version: nightly
  • cs-version: version of the installed Coursier (should be the latest available)

This action should work well with the official Coursier cache-action. For example:

steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v8
- uses: coursier/setup-action@v3