Giter Site home page Giter Site logo

setup-action's Introduction

Coursier setup GitHub 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).

Features

  • 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.

Inputs

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

Example with custom inputs

  steps:
    - uses: actions/checkout@v2
    - uses: coursier/setup-action@v1
      with:
        jvm: adopt:11
        jvm-index: https://url/of/your/index.json
        apps: sbtn bloop ammonite

Outputs

  • cs-version: version of the installed Coursier (should be the latest available)

Caching

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

  steps:
    - uses: actions/checkout@v2
    - uses: coursier/cache-action@v6
    - uses: coursier/setup-action@v1

setup-action's People

Contributors

2m avatar alexarchambault avatar balmungsan avatar dependabot[bot] avatar github-actions[bot] avatar laughedelic avatar mkurz avatar olafurpg avatar tgodzik avatar web-flow avatar xruialves avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

setup-action's Issues

Make the extension work on macOS and Windows

Really great to have such an extension, thanks for it @laughedelic!

FYI, I wrote this script some time ago (but didn't talk about it much at the time). It allows to get the coursier CLI for Linux / macOS / Windows, and also downloads it via the coursier cache, so that if cache-action runs before, nothing needs to be downloaded once the launcher is in cache. It also allows one to specify the coursier CLI version upfront (but needs to be updated when new coursier versions are tagged…).

You may want to embed that script in the action here, to have this extension work on macOS and Windows too, and use the cache. One point to pay attention to though, is that the coursier version it uses needs to be part of the cache key of cache-action. (Else the cache may not be saved after bumping the coursier version.)

It might be possible to pass parameters to cache-action from this action, I'm not sure… That said, it's not that big a deal if the CLI is not cached, as it's downloaded straight from GitHub…

Allow setting of custom arguments

I am using the action on a self-hosted runner which requires proxy settings. I don't seem to be able to set these, meaning coursier fails when installing apps

I tried to set JAVA_OPTS, however this doesn't seem to be possible (not sure if this would work anyway)

My understanding is, I would need to get coursier to run like this: coursier -J-Dhttps.proxyHost=… -J-Dhttps.proxyPort=… as documented here

If this makes sense as a useful feature, I'd be willing to work on a pull request. Let me know what you think

not installing the correct jvm

I'm using coursier/setup-action@v1
https://github.com/MasseGuillaume/porc-epic/blob/c7f39d786f24f2abfff1b23e8ffed9bd0f3a3e68/.github/workflows/ci.yml#L1-L20

setting the jvm to: graalvm:21

https://github.com/MasseGuillaume/porc-epic/runs/6169131815?check_suite_focus=true#step:4:21

output is

 openjdk version "1.8.0_292"
  OpenJDK Runtime Environment (build 1.8.0_292-b09)
  OpenJDK 64-Bit Server VM GraalVM CE 21.1.0 (build 25.292-b09-jvmci-21.1-b05, mixed mode)
  /opt/hostedtoolcache/cs/2.0.16/x64/cs java-home --jvm graalvm:21
  /home/runner/.cache/coursier/jvm/[email protected]

I'm expecting Java 17, am I missing something ?

Upgrade to node 16

Actions using Node 12 are considered deprecated and encouraged to upgrade to Node 16.
For reference: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/

I wonder if all that is needed is just changing this line.

runs:
-  using: 'node12'
+  using: 'node16'
  main: 'dist/index.js'

And refreshing the package-lock.json using Node 16.

If so, I am more than happy to help.
But, if something else is required I would need assistance / guidance.

See also: coursier/cache-action#410

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.