Closed stevepeak closed 9 years ago
Look like there where no reports found. Do you know how to include the following properly?
r_github_packages:
- jimhester/covr
before_install:
- ./travis-tool.sh install_github jimhester/covr
should do the trick. @stevepeak, many thanks for looking into this.
@msuchard Would adding this to our uploader be a viable solution to people using R to add the following method to our Bash Uploader? Goal is to make the integration with Codecov quicker. Thank you for helping.
Rscript -e 'library(devtools); library(methods); options(repos=c(CRAN="'"${CRAN}"'")); install_github(commandArgs(TRUE), build_vignettes = FALSE)' 'jimhester/covr'
extracted from travis-tools.sh#L222
@stevepeak That invocation can simply be
Rscript -e 'devtools::install_github("jimhester/covr")'
The legacy issue with devtools not loading the methods package has been fixed, so no need to load devtools and methods explicitly.
People should probably not need to override the default cran repository, but you can leave options(repos=c(CRAN="'"${CRAN}"'"))
if you want to. build_vignettes = FALSE
is the default, so it is unnecessary to make it explicit, and in this case what to install is constant, so no need to use commandArgs(TRUE)
.
@msuchard you are probably aware of this but travis-tools.sh is deprecated in favor of the native r support in travis (which is what
r_github_packages:
- jimhester/covr
is using). Unless you have a strong opposition to using it I would suggest porting your .yaml
to that instead.
@stevepeak One might want to ensure that devtools
is installed first via:
Rscript -e 'if (!require("devtools")) install.packages("devtools"); devtools::install_github("jimhester/covr")'
@jimhester Thanks for the reminder about R
support in Travis. I have given it a spin previously. But, I much prefer the output log format using language: c
in which the before_install
before_script
etc. blocks get folded in. Using language: r
generates one huge file to scroll through. Is there a way to folder away the R
installation?
@jimhester @msuchard If possible I would like to move these Rscript
commands into the bash uploader. At the end of your build when calling bash <(curl -s https://codecov.io/bash)
would it work to call the following commands:
Rscript -e 'if (!require("devtools")) install.packages("devtools"); devtools::install_github("jimhester/covr")' || true
Rscript -e 'library(covr); codecov()' || true
Using
|| true
to skip generated errors, unless you suggest a better method.
Calling Rscript
twice is actually kind of slow because the R interpreter takes a little while to start up, so I would probably combine them into one call. Also if there is an error in installing covr I would think you would want to propagate that error rather than skip it, as nothing is going to work it the package is not installed. The following is what I would probably do (multiple -e
calls simply run each statement in turn with the same interpreter)
Rscript -e 'if (!require("devtools")) install.packages("devtools")' \
-e 'devtools::install_github("jimhester/covr")' \
-e 'covr::codecov()'
Lets see if this fixes the issue. Thanks!