Skip to content

Commit

Permalink
[ci] fail R macOS CI jobs earlier when installations fail (#5129)
Browse files Browse the repository at this point in the history
* [ci] fail CI jobs earlier when installations fail

* more reliable link for R.pkg
  • Loading branch information
jameslamb committed Apr 6, 2022
1 parent 3fd2913 commit 3798f87
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .ci/test_r_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 3798f87

Please sign in to comment.