3232 steps :
3333 - checkout
3434 - run :
35- name : Set library for default R package installation
35+ name : Set environment
3636 command : |
37- # All packages will be installed into the directory
38- # referenced by the R_LIBS environment variable.
39- mkdir -p $HOME/Rlibs
40- ls -la ${R_LIBS}
4137 echo "export R_LIBS=$HOME/Rlibs" >> $BASH_ENV
4238 - run :
4339 name : Install R << parameters.r-version >>
@@ -48,12 +44,18 @@ jobs:
4844 brew tap r-lib/rig
4945 brew install --cask rig
5046 rig add $R_VERSION
47+ # on macOS the R package is installed into a MAJOR.MINOR directory
48+ # the PATCH is ignored (only one patch version supported) the
49+ # architecture is added as a suffix (arm64, x86_64) to allow for
50+ # installations to coexist
51+ rig default "${R_VERSION%.*}-arm64"
5152 elif [ "$RUNNER_OS" == "linux" ]; then
5253 `which sudo` curl -L https://rig.r-pkg.org/deb/rig.gpg -o /etc/apt/trusted.gpg.d/rig.gpg
5354 `which sudo` sh -c 'echo "deb http://rig.r-pkg.org/deb rig main" > /etc/apt/sources.list.d/rig.list'
5455 `which sudo` apt update
5556 `which sudo` apt install r-rig
5657 sudo rig add $R_VERSION
58+ sudo rig default $R_VERSION
5759 fi
5860 - run :
5961 name : System Dependencies
@@ -68,21 +70,21 @@ jobs:
6870 - run :
6971 name : Configuration Information
7072 command : |
71- echo "R_LIBS is: ${R_LIBS}"
72- c++ --version || gcc --version || echo "no c++ compiler found"
73+ mkdir -p ${R_LIBS}
74+ c++ --version
7375 cmake --version || echo "cmake not found"
74- make --version || echo "make not found"
75- R --version || echo "R not found"
76+ which R
77+ R --version
7678 - run :
7779 name : Install R packages
7880 command : |
79- R -e "install.packages(c('remotes'), repo='https://cloud.r-project.org/')"
81+ R -e "install.packages(c('remotes'), lib=c('${R_LIBS}'), repo='https://cloud.r-project.org/')"
8082 - run :
8183 name : Build and test
8284 no_output_timeout : 30m
8385 command : |
8486 set -x
85- R -e "remotes::install_git(c('.'), configure.vars=c('MAKEJ=3'))"
87+ R -e "remotes::install_git(c('.'), lib=c('${R_LIBS}'), configure.vars=c('MAKEJ=3'))"
8688
8789workflows :
8890 r-build-test :
@@ -92,9 +94,9 @@ workflows:
9294 matrix :
9395 parameters :
9496 r-version : ['4.3.1', '4.4.1']
95- os : ["macos-arm"
97+ os : ["macos-arm"]
9698 filters :
9799 branches :
98100 only :
99101 - main
100- - /pull\/.*/ # Run on all pull request branches
102+ - /pull\/.*/ # Run on all pull request branches
0 commit comments