Skip to content

Commit

Permalink
Fix cs bin directory on the M1 runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Gedochao committed Nov 20, 2023
1 parent cfdfd8a commit 7a7b520
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
- run: echo 'name := "foo"' > build.sbt
- id: scala-cli-setup
uses: ./
env:
COURSIER_BIN_DIR: ${{ github.workspace }}/cs/bin
with:
jvm: ${{ matrix.jvm }}
apps: sbt sbtn ammonite bloop:1.4.11
Expand Down
12 changes: 9 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,15 @@ async function run(): Promise<void> {
}
apps.push(`scala-cli${version ? `:${version}` : ''}`)
if (value && apps.length) {
const coursierBinDir = path.join(os.homedir(), 'cs', 'bin')
core.exportVariable('COURSIER_BIN_DIR', coursierBinDir)
core.addPath(coursierBinDir)
if (process.env.COURSIER_BIN_DIR) {
core.addPath(process.env.COURSIER_BIN_DIR)
} else {
const coursierBinDir = path.join(os.homedir(), 'cs', 'bin')
core.exportVariable('COURSIER_BIN_DIR', coursierBinDir)
core.addPath(coursierBinDir)
}
// eslint-disable-next-line no-console
console.log('COURSIER_BIN_DIR', process.env.COURSIER_BIN_DIR)
await cs('install', '--contrib', ...apps)
core.setOutput(
'scala-cli-version',
Expand Down

0 comments on commit 7a7b520

Please sign in to comment.