How to configure Travis for code without a package?

I would like to configure Travis CI for an R project hosted on Github, which is not a package. Unfortunately, the official support for R Travis seems to be pretty tightly tied to packages (which, to be fair, makes sense).

Is there any chance of getting this working for code other than the package, or is this my only call to the r-travis branch and fix it according to my specifications? I do not feel competent enough to do this easily.

Here is my unsuccessful Travis configuration:

language: R r_github_packages: - klmr/modules r_binary_packages: - testthat script: make test 

This fails with the following error:

Command "Rscript -e 'deps <- devtools::install_deps(dependencies = TRUE);if (!all(deps %in% installed.packages())) { message("missing: ", paste(setdiff(deps, installed.packages()), collapse=", ")); q(status = 1, save = "no")}'" failed and ended with 1 during.

This makes sense: devtools::install_deps only works in the package context.

Ive tried to suppress the installation step by adding install: true to my configuration. However, now the dependencies are no longer installed, and therefore the assembly is not performed using

Error in loadNamespace (name): no package called 'modules

+5
source share
1 answer

It turns out that the naive approach is quite simple; for my purposes the following works (full .travis.yml ):

 language: R install: - Rscript -e 'install.packages(c("devtools", "testthat"))' - Rscript -e 'devtools::install_github("klmr/modules")' script: make test 

However, Id still prefers a solution that can actually use Travis declarations ( r_binary_packages , etc.) instead of manually setting dependencies.

+3
source

Source: https://habr.com/ru/post/1242720/


All Articles