diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b37879b12cbb8cdb8a5a6f0f88b20fd8b5a7ef5..8b1ab731129bbaa26b80f73e1e2d4206b9f2b851 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,15 +1,12 @@ image: rocker/verse:latest stages: + - build - test - -variables: - R_LIBS_USER: "$CI_PROJECT_DIR/ci/lib" - CHECK_DIR: "$CI_PROJECT_DIR/ci/logs" - BUILD_LOGS_DIR: "$CI_PROJECT_DIR/ci/logs/$CI_PROJECT_NAME.Rcheck" - -buildcheck: - stage: test + - deploy + +buildpkg: + stage: build script: - apt-get update - apt-get install --yes --no-install-recommends r-cran-testthat r-cran-devtools @@ -19,11 +16,17 @@ buildcheck: - R -e 'install.packages(c("testthat","roxygen2"))' - R -e 'install.packages(c("knitr", "rmarkdown"))' # generate Documentation - - mkdir -p $R_LIBS_USER $BUILD_LOGS_DIR - #- R -e 'roxygen2::roxygenize(".", roclets=c("rd", "collate", "namespace"))'' - - R -e 'devtools::install_deps(dep = T, lib = Sys.getenv("R_LIBS_USER"))' - - R -e 'devtools::check(check_dir = Sys.getenv("CHECK_DIR"))' - - R -e 'if (length(devtools::check_failures(path = Sys.getenv("BUILD_LOGS_DIR"), note = FALSE)) > 0) stop()' - cache: - paths: - - $R_LIBS_USER \ No newline at end of file + - R -e 'roxygen2::roxygenize(".", roclets=c("rd", "collate", "namespace"))' + - R -e 'devtools::build(binary = TRUE)' + +checkpkg: + stage: test + script: + - R -e 'if (!identical(devtools::check(document = FALSE, args = "--no-tests")[["errors"]], character(0))) stop("Check with Errors")' + - R -e 'if (!identical(devtools::check(document = FALSE, args = "--no-tests")[["warnings"]], character(0))) stop("Check with Warnings")' + - R -e 'if (!identical(devtools::check(document = FALSE, args = "--no-tests")[["notes"]], character(0))) stop("Check with Notes")' + +installpkg: + stage: deploy + script: + - R -e 'devtools::install()'