Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add output parameter with path to installed JDK #65

Copy link
Copy link
@tbroyer

Description

@tbroyer
Issue body actions

When calling the action several times, it will overwrite the JAVA_HOME environment variable and prepend it to the PATH, effectively shadowing a previous run of the action.
Fortunately, it will also set a JAVA_HOME_<version>_<architecture> environment variable, but this could be more idiomatic as an output parameter (in addition to the environment variable, which can also be useful on its own: #44 (comment))

This would be a great addition to #21

That way, one could write something like:

- name: Setup JDK 11
  id: setup-java-11
  uses: actions/setup-java@v1
  with:
    java-version: 11
    # here with #21, one would disable "installation"
- name: Setup JDK 14
  id: setup-java-14
  uses: actions/setup-java@v1
  with:
    java-version: 14
    # here with #21, one would disable "installation"
- name: Setup JDK 8
  # Ran last due each run shadowing the previous ones; see also #21
  uses: actions/setup-java@v1
  with:
    java-version: 8
- name: Build and run tests (with JDK 8)
  run: ./gradlew build
- name: Run tests with JDK 11
  run: ./gradlew test -Ptest.jdk-path="${{ steps.setup-java-11.outputs.jdk-path }}"
- name: Run tests with JDK 14
  run: ./gradlew test -Ptest.jdk-path="${{ steps.setup-java-14.outputs.jdk-path }}"

(here, the build is still running with JDK 8, but it coud configure its tests to actually use another JDK)

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.