File tree Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 1414 strategy :
1515 fail-fast : false
1616 matrix :
17- os : [ubuntu-latest, macOS-latest, windows-latest]
17+ os : [ubuntu-latest, macOS-latest, macOS-m1, windows-latest]
1818 jvm : ['temurin:17']
1919 steps :
2020 - uses : actions/checkout@v4
3131 - run : echo 'name := "foo"' > build.sbt
3232 - id : scala-cli-setup
3333 uses : ./
34+ env :
35+ COURSIER_BIN_DIR : ${{ github.workspace }}/cs/bin
3436 with :
3537 jvm : ${{ matrix.jvm }}
3638 apps : sbt sbtn ammonite bloop:1.4.11
Original file line number Diff line number Diff line change @@ -25,6 +25,18 @@ A GitHub Action to install Scala CLI.
2525 option, like publishing.
2626 - Defaults to ` false `
2727
28+ ### Environment variables
29+ - ` JAVA_HOME ` : path to the JVM to use
30+ - ` COURSIER_BIN_DIR ` : (optional) path to the directory where Coursier will install app binaries
31+ - defaults to ` $HOME/cs/bin `
32+ - shouldn't have to be tampered with for vanilla GitHub action runners
33+ - make sure the directory is reachable for self-hosted runners
34+ - in case of issues, you can set it to something like
35+ ``` yaml
36+ env :
37+ COURSIER_BIN_DIR : ${{ github.workspace }}/cs/bin
38+ ` ` `
39+
2840### Example with custom inputs
2941
3042` ` ` yml
Original file line number Diff line number Diff line change @@ -139,9 +139,17 @@ async function run(): Promise<void> {
139139 }
140140 apps . push ( `scala-cli${ version ? `:${ version } ` : '' } ` )
141141 if ( value && apps . length ) {
142- const coursierBinDir = path . join ( os . homedir ( ) , 'cs' , 'bin' )
143- core . exportVariable ( 'COURSIER_BIN_DIR' , coursierBinDir )
144- core . addPath ( coursierBinDir )
142+ if ( process . env . COURSIER_BIN_DIR ) {
143+ core . info (
144+ `Using the cs bin directory from COURSIER_BIN_DIR: ${ process . env . COURSIER_BIN_DIR } ` ,
145+ )
146+ core . addPath ( process . env . COURSIER_BIN_DIR )
147+ } else {
148+ const coursierBinDir = path . join ( os . homedir ( ) , 'cs' , 'bin' )
149+ core . info ( `Setting COURSIER_BIN_DIR to: ${ coursierBinDir } ` )
150+ core . exportVariable ( 'COURSIER_BIN_DIR' , coursierBinDir )
151+ core . addPath ( coursierBinDir )
152+ }
145153 await cs ( 'install' , '--contrib' , ...apps )
146154 core . setOutput (
147155 'scala-cli-version' ,
You can’t perform that action at this time.
0 commit comments