I am building an R Package on GitLab and I am trying to get the GitLab CI to work, the issues are
devtools::check
fails if there is an error, warning or note. I only want it to fail on errors- Deploy
pkgdown
to GitLab pages, it doesn't seem to work?
Below is the .gitlab-ci-yml
I am using. I used the R package template from R Studio to test it.
# .gitlab-ci.yml
image: methodsconsultants/r-packaging
variables:
DOCKER_DRIVER: overlay2
PKGNAME: "test"
R_LIBS_USER: "$CI_PROJECT_DIR/ci/lib"
CHECK_DIR: "$CI_PROJECT_DIR/ci/logs"
BUILD_LOGS_DIR: "$CI_PROJECT_DIR/ci/logs/$PKGNAME.Rcheck"
cache:
paths:
- $R_LIBS_USER
- vendor/apt
stages:
- build
- check
- test
- pages
before_script:
- mkdir -p vendor/apt
- apt-get --allow-releaseinfo-change update -qq
- apt-get remove -y libgcc-8-dev
- apt-get -o dir::cache::archives="vendor/apt" install -y libcairo2-dev -qq
buildbinary:
stage: build
script:
- r -e 'devtools::build(binary = TRUE)'
checkErrors:
stage: check
script:
- r -e 'if (!identical(devtools::check(document = FALSE, args = "--no-tests")[["errors"]], character(0))) stop("Check with Errors")'
unittests:
stage: test
script:
- r -e 'if (any(as.data.frame(devtools::test())[["failed"]] > 0)) stop("Some tests failed.")'
pages:
script:
- R -e "pkgdown::build_site()"
artifacts:
paths:
- public
only:
- master
Note
- Everything works locally,
devtools::check()
produces warnings and notes but no errors.pkgdown
builds fine. tests pass fine. - Gitlab CI is working, the build step and test stages pass fine, then fails on
devtools::check()
error message - I tried gitlab pages by removing the
check()
phrase, the pipeline finishes fine but undersetting > Pages
I can't see anything?