actions / setup-java

Set up your GitHub Actions workflow with a specific version of Java
MIT License
1.54k stars 739 forks source link

`setup-java@v4` setup for sbt failing on Linux with `sbt: command not found` #694

Open dnkanga opened 22 hours ago

dnkanga commented 22 hours ago

Description: This seemingly broke overnight, i'm attempting to setup the build with this

jobs:
  unit-test-with-coverage:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Set up JDK 11
        uses: actions/setup-java@v4
        with:
          java-version: '11'
          distribution: 'adopt'

      - name: Compile and run tests
        run: sbt clean coverage test coverageReport

and the build is failing with

Run sbt clean coverage test coverageReport
  sbt clean coverage test coverageReport
  shell: /usr/bin/bash -e {0}
  env:
    GITHUB_TOKEN: ***
    ORG_TOKEN: ***
    JAVA_HOME: /opt/hostedtoolcache/Java_Adopt_jdk/11.0.24-8/x64
    JAVA_HOME_11_X64: /opt/hostedtoolcache/Java_Adopt_jdk/11.0.24-8/x64
/home/runner/work/_temp/b7c25d22-b1b1-4c67-b34a-c29a4ed01426.sh: line 1: sbt: command not found
Error: Process completed with exit code 127.

Platform:

Runner type:

marvinborner commented 6 hours ago

I also have this issue. This is likely because of the ubuntu-latest update which no longer includes sbt by default.

Also using the sbt/setup-sbt action fixes it.