diff --git a/.ci/test_r_package.sh b/.ci/test_r_package.sh index 2f429df85ea4..1b83f4582a50 100755 --- a/.ci/test_r_package.sh +++ b/.ci/test_r_package.sh @@ -12,32 +12,24 @@ export PATH="$R_LIB_PATH/R/bin:$PATH" export _R_CHECK_SYSTEM_CLOCK_=0 # Get details needed for installing R components -# -# NOTES: -# * Linux builds on Azure use a container and don't need these details -if ! { [[ $AZURE == "true" ]] && [[ $OS_NAME == "linux" ]]; }; then - R_MAJOR_VERSION=( ${R_VERSION//./ } ) - if [[ "${R_MAJOR_VERSION}" == "3" ]]; then - export R_MAC_VERSION=3.6.3 - 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.0.2 - export R_LINUX_VERSION="4.0.2-1.1804.0" - export R_APT_REPO="bionic-cran40/" - else - echo "Unrecognized R version: ${R_VERSION}" - exit -1 - fi +R_MAJOR_VERSION=( ${R_VERSION//./ } ) +if [[ "${R_MAJOR_VERSION}" == "3" ]]; then + export R_MAC_VERSION=3.6.3 + 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.0.2 + export R_LINUX_VERSION="4.0.2-1.1804.0" + export R_APT_REPO="bionic-cran40/" +else + echo "Unrecognized R version: ${R_VERSION}" + exit -1 fi # installing precompiled R for Ubuntu # https://cran.r-project.org/bin/linux/ubuntu/#installation # adding steps from https://stackoverflow.com/a/56378217/3986677 to get latest version -# -# This only needs to get run on Travis because R environment for Linux -# used by Azure pipelines is set up in https://github.com/guolinke/lightgbm-ci-docker -if [[ $AZURE != "true" ]] && [[ $OS_NAME == "linux" ]]; then +if [[ $OS_NAME == "linux" ]]; then sudo apt-key adv \ --keyserver keyserver.ubuntu.com \ --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9