Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions setup-r-dependencies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ On Windows you can usually use `pacman` that is included in Rtools4, or
choco install mariadb
```

`setup-r-dependencies` also sets `JAVA_HOME` to Java 21 on GitHub-hosted
Windows runners (`JAVA_HOME_21_X64` on x64, `JAVA_HOME_21_AARCH64` on arm64)
if `JAVA_HOME` is not already set.

# Installing the latest dependencies

Note that `setup-r-dependencies` does _not_ necessarily install the latest
Expand Down
14 changes: 14 additions & 0 deletions setup-r-dependencies/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,20 @@ runs:
cat("::endgroup::\n")
shell: Rscript {0}

- name: Set JAVA_HOME (Windows)
if: ${{ runner.os == 'Windows' }}
shell: bash
run: |
if [ -z "${JAVA_HOME:-}" ]; then
arch="${RUNNER_ARCH^^}"
case "${arch}" in
X64) echo "JAVA_HOME=${JAVA_HOME_21_X64}" >> $GITHUB_ENV ;;
# GitHub runners expose ARM64 Java 21 in JAVA_HOME_21_AARCH64.
ARM64) echo "JAVA_HOME=${JAVA_HOME_21_AARCH64}" >> $GITHUB_ENV ;;
*) echo "Warning: unsupported Windows architecture '${arch}', JAVA_HOME not set by setup-r-dependencies." >&2 ;;
esac
fi

- name: Install pak (Unix)
if: ${{ runner.os != 'Windows' && inputs.pak-version != 'none' }}
run: |
Expand Down