diff --git a/.ci/test_r_package.sh b/.ci/test_r_package.sh index ee9aa8dd03b2..6d421f16be56 100755 --- a/.ci/test_r_package.sh +++ b/.ci/test_r_package.sh @@ -68,6 +68,15 @@ if [[ $OS_NAME == "linux" ]]; then automake \ || exit -1 fi + if [[ $INSTALL_CMAKE_FROM_RELEASES == "true" ]]; then + curl -O -L \ + https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1-linux-x86_64.sh \ + || exit -1 + + sudo mkdir /opt/cmake || exit -1 + sudo sh cmake-3.25.1-linux-x86_64.sh --skip-license --prefix=/opt/cmake || exit -1 + sudo ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake || exit -1 + fi fi # Installing R precompiled for Mac OS 10.11 or higher diff --git a/.github/workflows/r_package.yml b/.github/workflows/r_package.yml index 83d0fa0eab3a..d5d0f389bf08 100644 --- a/.github/workflows/r_package.yml +++ b/.github/workflows/r_package.yml @@ -44,7 +44,7 @@ jobs: compiler: gcc r_version: 3.6 build_type: cmake - container: 'ubuntu:20.04' + container: 'ubuntu:18.04' - os: ubuntu-latest task: r-package compiler: gcc @@ -56,7 +56,7 @@ jobs: compiler: clang r_version: 3.6 build_type: cmake - container: 'ubuntu:20.04' + container: 'ubuntu:18.04' - os: ubuntu-latest task: r-package compiler: clang @@ -180,6 +180,12 @@ jobs: - name: Install pandoc uses: r-lib/actions/setup-pandoc@v2 if: matrix.r_version != '3.6' + # R 3.6 binary isn't easily available on buntu 18.04, + # but setup-pandoc>=2.7.1 is uses a too-new glibc for it. + # ref: https://github.com/microsoft/LightGBM/issues/6298 + - name: Install pandoc + uses: r-lib/actions/setup-pandoc@v2.7.0 + if: matrix.r_version == '3.6' - name: install tinytex if: startsWith(matrix.os, 'windows') uses: r-lib/actions/setup-tinytex@v2 @@ -198,6 +204,11 @@ jobs: elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then export OS_NAME="linux" export IN_UBUNTU_BASE_CONTAINER="true" + # the default version of cmake provided on Ubuntu 18.04 (v3.10.2), is not supported by LightGBM + # see https://github.com/microsoft/LightGBM/issues/5642 + if [[ "${{ matrix.container }}" == "ubuntu:18.04" ]]; then + export INSTALL_CMAKE_FROM_RELEASES="true" + fi fi export BUILD_DIRECTORY="$GITHUB_WORKSPACE" export R_VERSION="${{ matrix.r_version }}"