@@ -18,6 +18,12 @@ executors:
1818 environment :
1919 RUNNER_OS : macos
2020 resource_class : m4pro.medium
21+ windows :
22+ machine :
23+ image : windows-server-2022-gui:current
24+ environment :
25+ RUNNER_OS : windows
26+ resource_class : windows.large
2127
2228jobs :
2329 r-build :
3238 steps :
3339 - checkout
3440 - run :
35- name : Set environment
41+ name : Set library for default R package installation
3642 command : |
43+ # All packages will be installed into the directory
44+ # referenced by the R_LIBS environment variable.
45+ mkdir -p $HOME/Rlibs
46+ ls -la ${R_LIBS}
3747 echo "export R_LIBS=$HOME/Rlibs" >> $BASH_ENV
3848 - run :
3949 name : Install R << parameters.r-version >>
@@ -44,18 +54,17 @@ jobs:
4454 brew tap r-lib/rig
4555 brew install --cask rig
4656 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"
5257 elif [ "$RUNNER_OS" == "linux" ]; then
5358 `which sudo` curl -L https://rig.r-pkg.org/deb/rig.gpg -o /etc/apt/trusted.gpg.d/rig.gpg
5459 `which sudo` sh -c 'echo "deb http://rig.r-pkg.org/deb rig main" > /etc/apt/sources.list.d/rig.list'
5560 `which sudo` apt update
5661 `which sudo` apt install r-rig
5762 sudo rig add $R_VERSION
58- sudo rig default $R_VERSION
63+ elif [ "$RUNNER_OS" == "windows" ]; then
64+ choco install rig -y
65+ export PATH="$PATH:/c/Program Files/rig"
66+ rig add $R_VERSION
67+ echo "export PATH=\"/c/Program Files/R/R-$R_VERSION/bin:\$PATH\"" >> $BASH_ENV
5968 fi
6069 - run :
6170 name : System Dependencies
@@ -66,25 +75,29 @@ jobs:
6675 sudo rm -rf /var/lib/apt/lists/*
6776 elif [ "$RUNNER_OS" == "macos" ]; then
6877 brew install cmake
78+ elif [ "$RUNNER_OS" == "windows" ]; then
79+ choco install rtools -y
80+ RTOOLS_ROOT=$(ls -d /c/rtools* | head -n 1)
81+ echo "export PATH=\"$CMAKE_DIR:$RTOOLS_ROOT/x86_64-w64-mingw32.static.posix/bin:$RTOOLS_ROOT/usr/bin:\$PATH\"" >> $BASH_ENV
6982 fi
7083 - run :
7184 name : Configuration Information
7285 command : |
73- mkdir -p ${R_LIBS}
74- c++ --version
86+ echo $PATH
87+ echo "R_LIBS is: ${R_LIBS}"
88+ c++ --version || gcc --version || echo "no c++ compiler found"
7589 cmake --version || echo "cmake not found"
76- which R
77- R --version
90+ R --version || echo "R not found"
7891 - run :
7992 name : Install R packages
8093 command : |
81- R -e "install.packages(c('remotes'), lib=c('${R_LIBS}'), repo='https://cloud.r-project.org/')"
94+ R -e "install.packages(c('remotes'), repo='https://cloud.r-project.org/')"
8295 - run :
8396 name : Build and test
8497 no_output_timeout : 30m
8598 command : |
8699 set -x
87- R -e "remotes::install_git(c('.'), lib=c('${R_LIBS}'), configure.vars=c('MAKEJ=3'))"
100+ R -e "remotes::install_git(c('.'), configure.vars=c('MAKEJ=3'))"
88101
89102workflows :
90103 r-build-test :
@@ -94,7 +107,7 @@ workflows:
94107 matrix :
95108 parameters :
96109 r-version : ['4.3.1', '4.4.1']
97- os : ["macos-arm"]
110+ os : ["macos-arm", "windows" ]
98111 filters :
99112 branches :
100113 only :
0 commit comments