Skip to content

Commit 3798f87

Browse files
authored
[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
1 parent 3fd2913 commit 3798f87

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.ci/test_r_package.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ fi
1717
R_MAJOR_VERSION=( ${R_VERSION//./ } )
1818
if [[ "${R_MAJOR_VERSION}" == "3" ]]; then
1919
export R_MAC_VERSION=3.6.3
20+
export R_MAC_PKG_URL=https://cran.r-project.org/bin/macosx/R-${R_MAC_VERSION}.pkg
2021
export R_LINUX_VERSION="3.6.3-1bionic"
2122
export R_APT_REPO="bionic-cran35/"
2223
elif [[ "${R_MAJOR_VERSION}" == "4" ]]; then
2324
export R_MAC_VERSION=4.1.2
25+
export R_MAC_PKG_URL=https://cran.r-project.org/bin/macosx/base/R-${R_MAC_VERSION}.pkg
2426
export R_LINUX_VERSION="4.1.2-1.2004.0"
2527
export R_APT_REPO="focal-cran40/"
2628
else
@@ -66,20 +68,20 @@ fi
6668
if [[ $OS_NAME == "macos" ]]; then
6769
brew update-reset && brew update
6870
if [[ $R_BUILD_TYPE == "cran" ]]; then
69-
brew install automake
71+
brew install automake || exit -1
7072
fi
7173
brew install \
7274
checkbashisms \
73-
qpdf
74-
brew install --cask basictex
75+
qpdf || exit -1
76+
brew install --cask basictex || exit -1
7577
export PATH="/Library/TeX/texbin:$PATH"
76-
sudo tlmgr --verify-repo=none update --self
77-
sudo tlmgr --verify-repo=none install inconsolata helvetic
78+
sudo tlmgr --verify-repo=none update --self || exit -1
79+
sudo tlmgr --verify-repo=none install inconsolata helvetic || exit -1
7880

79-
curl -sL https://cran.r-project.org/bin/macosx/R-${R_MAC_VERSION}.pkg -o R.pkg
81+
curl -sL ${R_MAC_PKG_URL} -o R.pkg || exit -1
8082
sudo installer \
8183
-pkg $(pwd)/R.pkg \
82-
-target /
84+
-target / || exit -1
8385

8486
# Older R versions (<= 4.1.2) on newer macOS (>= 11.0.0) cannot create the necessary symlinks.
8587
# See https://github.com/r-lib/actions/issues/412.

0 commit comments

Comments
 (0)