From 3798f8720f4fbc4f1249717fb8f2f037e0075a46 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 5 Apr 2022 22:17:58 -0500 Subject: [PATCH] [ci] fail R macOS CI jobs earlier when installations fail (#5129) * [ci] fail CI jobs earlier when installations fail * more reliable link for R.pkg --- .ci/test_r_package.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.ci/test_r_package.sh b/.ci/test_r_package.sh index 1a96d4b4c..a6d6a0b47 100755 --- a/.ci/test_r_package.sh +++ b/.ci/test_r_package.sh @@ -17,10 +17,12 @@ fi R_MAJOR_VERSION=( ${R_VERSION//./ } ) if [[ "${R_MAJOR_VERSION}" == "3" ]]; then export R_MAC_VERSION=3.6.3 + export R_MAC_PKG_URL=https://cran.r-project.org/bin/macosx/R-${R_MAC_VERSION}.pkg 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.2 + export R_MAC_PKG_URL=https://cran.r-project.org/bin/macosx/base/R-${R_MAC_VERSION}.pkg export R_LINUX_VERSION="4.1.2-1.2004.0" export R_APT_REPO="focal-cran40/" else @@ -66,20 +68,20 @@ fi if [[ $OS_NAME == "macos" ]]; then brew update-reset && brew update if [[ $R_BUILD_TYPE == "cran" ]]; then - brew install automake + brew install automake || exit -1 fi brew install \ checkbashisms \ - qpdf - brew install --cask basictex + qpdf || exit -1 + brew install --cask basictex || exit -1 export PATH="/Library/TeX/texbin:$PATH" - sudo tlmgr --verify-repo=none update --self - sudo tlmgr --verify-repo=none install inconsolata helvetic + sudo tlmgr --verify-repo=none update --self || exit -1 + sudo tlmgr --verify-repo=none install inconsolata helvetic || exit -1 - curl -sL https://cran.r-project.org/bin/macosx/R-${R_MAC_VERSION}.pkg -o R.pkg + curl -sL ${R_MAC_PKG_URL} -o R.pkg || exit -1 sudo installer \ -pkg $(pwd)/R.pkg \ - -target / + -target / || exit -1 # 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.