R support on Windows

Hi!

R support for windows would be amazing! Then I can ditch Appveyor which never seems to work!!

Cheers,
Roy

1 Like

I have R support for Travis Ubuntu, Travis Windows, and Appveyor, without package compilation. And also Gitlab CI with images of most common distros. See https://github.com/coala/coala-bears/pull/2910 and https://gitlab.com/coala/package_manager/pipelines/68370247

A useful trick is set env var R_COMPILE_AND_INSTALL_PACKAGES=never, which speeds up any dependencies and removes the requirement to have compilers working.

If your own package needs compilers, this wont work.

If you could post the URL to your project, we might be able to help you get it working.

Try that, and you need to include oledlg.dll in your repository or provide a curl download for it:

os: windows
language: bash

cache:
    directories:
    - $HOME/AppData/Local/Temp/chocolatey

install:
 - choco install -y r --version 3.6.2
 - choco install -y rtools --version 3.5.0.4
 - "url=$(curl https://miktex.org/download | sed -n 's/.*href=.\\(.*x64.exe\\).*/https:\\/\\/miktex.org\\1/p' | head -1)"
 - if ! [ -f $HOME/AppData/Local/Temp/chocolatey/miktex.exe ]; then
   curl -Lo $HOME/AppData/Local/Temp/chocolatey/miktex.exe $url;
   fi
 - $HOME/AppData/Local/Temp/chocolatey/miktex.exe --unattended --auto-install=yes 
 - "export PATH=/c/Program\\ Files/MiKTeX\\ 2.9/miktex/bin/x64:$PATH"
 - choco install -y pandoc
 - "export PATH=/c/Program\\ Files/R/R-3.6.2/bin/x64:/c/Rtools/bin:/c/RTools/mingw_64/bin:$PATH"
 - mkdir -p ${HOME}/Documents/R/win-library/3.6
 - export R_LIBS_USER=${HOME}/Documents/R/win-library/3.6
 - echo 'options(repos = c(CRAN = "https://cloud.r-project.org"))' > .Rprofile
 - Rscript -e 'install.packages("devtools")'
 - Rscript -e 'install.packages(c("remotes"));if (!all(c("remotes") %in% installed.packages())) { q(status = 1, save = "no")}'
 - "Rscript -e 'deps <- remotes::dev_package_deps(dependencies = NA);remotes::install_deps(dependencies = TRUE);if (!all(deps$package %in% installed.packages())) { message(\"missing: \", paste(setdiff(deps$package, installed.packages()), collapse=\", \")); q(status = 1, save = \"no\")}'"

script:
- R CMD build .
- R CMD check *tar.gz --as-cran
Imprint