diff --git a/.ci/test_r_package.sh b/.ci/test_r_package.sh index e7d36e59ceeb..80ac4f141c2f 100755 --- a/.ci/test_r_package.sh +++ b/.ci/test_r_package.sh @@ -20,8 +20,8 @@ if [[ "${R_MAJOR_VERSION}" == "3" ]]; then export R_LINUX_VERSION="3.6.3-1bionic" export R_APT_REPO="bionic-cran35/" elif [[ "${R_MAJOR_VERSION}" == "4" ]]; then - export R_MAC_VERSION=4.1.1 - export R_LINUX_VERSION="4.1.1-1.2004.0" + export R_MAC_VERSION=4.1.2 + export R_LINUX_VERSION="4.1.2-1.2004.0" export R_APT_REPO="focal-cran40/" else echo "Unrecognized R version: ${R_VERSION}" @@ -81,6 +81,19 @@ if [[ $OS_NAME == "macos" ]]; then -pkg $(pwd)/R.pkg \ -target / + # Older R versions (<= 4.1.2) on newer macOS (>= 11.0.0) cannot create the necessary symlinks. + # See https://github.com/r-lib/actions/issues/412. + if [[ $(sw_vers -productVersion | head -c2) -ge "11" ]]; then + sudo ln \ + -sf \ + /Library/Frameworks/R.framework/Resources/bin/R \ + /usr/local/bin/R + sudo ln \ + -sf \ + /Library/Frameworks/R.framework/Resources/bin/Rscript \ + /usr/local/bin/Rscript + fi + # Fix "duplicate libomp versions" issue on Mac # by replacing the R libomp.dylib with a symlink to the one installed with brew if [[ $COMPILER == "clang" ]]; then diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index 62562b471345..ffbfeca897b0 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -78,7 +78,7 @@ if ($env:R_MAJOR_VERSION -eq "3") { $env:RTOOLS_BIN = "$RTOOLS_INSTALL_PATH\usr\bin" $env:RTOOLS_MINGW_BIN = "$RTOOLS_INSTALL_PATH\mingw64\bin" $env:RTOOLS_EXE_FILE = "rtools40v2-x86_64.exe" - $env:R_WINDOWS_VERSION = "4.1.1" + $env:R_WINDOWS_VERSION = "4.1.2" } else { Write-Output "[ERROR] Unrecognized R version: $env:R_VERSION" Check-Output $false diff --git a/.github/workflows/r_package.yml b/.github/workflows/r_package.yml index b2e162610705..8059dbb705a5 100644 --- a/.github/workflows/r_package.yml +++ b/.github/workflows/r_package.yml @@ -40,7 +40,7 @@ jobs: - os: ubuntu-latest task: r-package compiler: gcc - r_version: 4.0 + r_version: 4.1 build_type: cmake - os: ubuntu-latest task: r-package @@ -50,27 +50,27 @@ jobs: - os: ubuntu-latest task: r-package compiler: clang - r_version: 4.0 + r_version: 4.1 build_type: cmake - os: macOS-latest task: r-package compiler: gcc r_version: 3.6 build_type: cmake - - os: macOS-latest + - os: macOS-10.15 task: r-package compiler: gcc - r_version: 4.0 + r_version: 4.1 build_type: cmake - os: macOS-latest task: r-package compiler: clang r_version: 3.6 build_type: cmake - - os: macOS-latest + - os: macOS-10.15 task: r-package compiler: clang - r_version: 4.0 + r_version: 4.1 build_type: cmake - os: windows-latest task: r-package @@ -82,7 +82,7 @@ jobs: task: r-package compiler: MINGW toolchain: MSYS - r_version: 4.0 + r_version: 4.1 build_type: cmake # Visual Studio 2017 - os: windows-2016 @@ -96,14 +96,14 @@ jobs: task: r-package compiler: MSVC toolchain: MSVC - r_version: 4.0 + r_version: 4.1 build_type: cmake # Visual Studio 2022 - os: windows-2022 task: r-package compiler: MSVC toolchain: MSVC - r_version: 4.0 + r_version: 4.1 build_type: cmake ############### # CRAN builds # @@ -118,17 +118,17 @@ jobs: task: r-package compiler: MINGW toolchain: MSYS - r_version: 4.0 + r_version: 4.1 build_type: cran - os: ubuntu-latest task: r-package compiler: gcc - r_version: 4.0 + r_version: 4.1 build_type: cran - - os: macOS-latest + - os: macOS-10.15 task: r-package compiler: clang - r_version: 4.0 + r_version: 4.1 build_type: cran ################ # Other checks # @@ -136,7 +136,7 @@ jobs: - os: ubuntu-latest task: r-rchk compiler: gcc - r_version: 4.0 + r_version: 4.1 build_type: cran steps: - name: Prevent conversion of line endings on Windows @@ -151,13 +151,13 @@ jobs: - name: Install pandoc uses: r-lib/actions/setup-pandoc@v1 - name: Setup and run tests on Linux and macOS - if: matrix.os == 'macOS-latest' || matrix.os == 'ubuntu-latest' + if: startsWith(matrix.os, 'macOS') || matrix.os == 'ubuntu-latest' shell: bash run: | export TASK="${{ matrix.task }}" export COMPILER="${{ matrix.compiler }}" export GITHUB_ACTIONS="true" - if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then + if [[ $(echo "${{ matrix.os }}" | head -c5) == "macOS" ]]; then export OS_NAME="macos" elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then export OS_NAME="linux"