R/buildsteps_templates.R
cr_buildstep_packagetests.Rd
This lets you run R package tests and is intended to be used in a trigger when you push to a repository so you can monitor code quality.
cr_buildstep_packagetests( test_script = NULL, codecov_script = NULL, codecov_token = "$_CODECOV_TOKEN", build_image = "gcr.io/gcer-public/packagetools:latest", env = c("NOT_CRAN=true") )
test_script | The script that will perform tests. If |
---|---|
codecov_script | The script that will perform coverage. If |
codecov_token | If using codecov, supply your codecov token here. |
build_image | The docker image that will be used to run the R code for the test scripts |
env | Environment arguments to be set during the test script runs |
cr_buildstep_packagetests()#> [[1]] #> ==cloudRunnerBuildStep== #> name: gcr.io/gcer-public/packagetools:latest #> args: #> - Rscript #> - -e #> - |- #> message("cran mirror: ", getOption("repos")) #> remotes::install_deps(dependencies = TRUE) #> rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning') #> env: #> - NOT_CRAN=true #> #> [[2]] #> ==cloudRunnerBuildStep== #> name: gcr.io/gcer-public/packagetools:latest #> args: #> - Rscript #> - -e #> - |- #> remotes::install_deps(dependencies = TRUE) #> remotes::install_local() #> cv <- covr::package_coverage() #> print(cv) #> covr::codecov(coverage=cv, commit = '$$COMMIT_SHA', branch = '$$BRANCH_NAME') #> env: #> - NOT_CRAN=true #> - CODECOV_TOKEN=$_CODECOV_TOKEN #>