diff --git a/.github/workflows/e2e-smoke.yml b/.github/workflows/e2e-smoke.yml index 65314acb..fed3adf7 100644 --- a/.github/workflows/e2e-smoke.yml +++ b/.github/workflows/e2e-smoke.yml @@ -33,6 +33,30 @@ jobs: distribution: temurin version: '21' java-package: jdk + - os: macos-latest + distribution: temurin + version: '25' + java-package: jdk + - os: windows-latest + distribution: temurin + version: '25' + java-package: jdk + - os: ubuntu-latest + distribution: temurin + version: '25' + java-package: jdk + - os: macos-latest + distribution: microsoft + version: '25' + java-package: jdk + - os: windows-latest + distribution: microsoft + version: '25' + java-package: jdk + - os: ubuntu-latest + distribution: microsoft + version: '25' + java-package: jdk - os: ubuntu-latest distribution: zulu version: '17' diff --git a/README.md b/README.md index 27e7de46..38ecc35f 100644 --- a/README.md +++ b/README.md @@ -325,6 +325,8 @@ In the basic examples above, the `check-latest` flag defaults to `false`. When s If `check-latest` is set to `true`, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, the latest version of Java will be downloaded. Set `check-latest` to `true` if you want the most up-to-date version of Java to always be used. Setting `check-latest` to `true` has performance implications as downloading versions of Java is slower than using cached versions. +[GitHub-hosted runners](https://github.com/actions/runner-images) include Eclipse Temurin JDKs in their tool cache. Selecting Eclipse Temurin (`distribution: 'temurin'`) can save setup time by using a pre-installed JDK instead of downloading one. See the installed Java versions for [Ubuntu](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java), [Windows](https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-Readme.md#java), and [macOS](https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#java). + For Java distributions that are not cached on Hosted images, `check-latest` always behaves as `true` and downloads Java on the fly. Check out [Hosted Tool Cache](docs/advanced-usage.md#Hosted-Tool-Cache) for more details about pre-cached Java versions. diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index 9c4ef5de..1a429ad6 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -890,9 +890,9 @@ See the help docs on [Publishing a Package with Gradle](https://help.github.com/ ## Hosted Tool Cache GitHub Hosted Runners have a tool cache that comes with some Java versions pre-installed. This tool cache helps speed up runs and tool setup by not requiring any new downloads. There is an environment variable called `RUNNER_TOOL_CACHE` on each runner that describes the location of this tools cache and this is where you can find the pre-installed versions of Java. `setup-java` works by taking a specific version of Java in this tool cache and adding it to PATH if the version, architecture and distribution match. -Currently, LTS versions of Eclipse Temurin (`temurin`) are cached on the GitHub Hosted Runners. +Currently, LTS versions of Eclipse Temurin (`temurin`) are cached on GitHub-hosted runners. Using a cached version avoids downloading a JDK. -The tools cache gets updated on a weekly basis. For information regarding locally cached versions of Java on GitHub hosted runners, check out [GitHub Actions Virtual Environments](https://github.com/actions/virtual-environments). +The tools cache gets updated on a weekly basis. See the installed Java versions for [Ubuntu](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java), [Windows](https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-Readme.md#java), and [macOS](https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#java). ## Modifying Maven Toolchains The `setup-java` action generates a basic [Maven Toolchains declaration](https://maven.apache.org/guides/mini/guide-using-toolchains.html) for specified Java versions by either creating a minimal toolchains file or extending an existing declaration with the additional JDKs.