gitlabr
gitlabr copied to clipboard
As a user I would like the gitlab-ci.yml template to be up-to-date
- [ ] The REPO_NAME variable is not set as a global variable
- [ ] {pak} is used instead of remotes
- [ ] A between job cache is used ? cf infra
image: rocker/verse:latest
variables:
GIT_DEPTH: 10
REPO_NAME: "https://packagemanager.rstudio.com/all/__linux__/focal/latest"
R_LIBS_USER: "ci/lib"
cache:
# key: global-cache
paths:
- ${R_LIBS_USER}
stages:
- install
- check
install:
stage: install
script:
- lsb_release -c
- R -e "sessionInfo()"
- if [[ $CI_DEFAULT_BRANCH == "master" || $CI_DEFAULT_BRANCH = "main" ]]; then echo "OK - Default branch is master or main"; else echo "Default branch is not master or main; please add yours ($CI_DEFAULT_BRANCH) where needed, as well as in the present line of code" ; exit 1; fi
- apt-get update -qq && apt-get install -y libharfbuzz-dev libfribidi-dev
- echo "Library path for packages :" $R_LIBS_USER
- mkdir -p $R_LIBS_USER
- Rscript -e 'install.packages("remotes")'
- Rscript -e 'install.packages("rcmdcheck")'
- Rscript -e 'remotes::install_local(upgrade = "always")'
cache:
key: ${CI_COMMIT_REF_SLUG}-dependencies
paths:
- ${R_LIBS_USER}
artifacts:
paths:
- install
expire_in: 30 days
check:
stage: check
script:
- R -e 'rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")'
cache:
key: ${CI_COMMIT_REF_SLUG}-dependencies
paths:
- ${R_LIBS_USER}
artifacts:
paths:
- check
expire_in: 30 days